A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Running & Setting Up Queries
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Looking for Existing Records



 
 
Thread Tools Display Modes
  #1  
Old July 5th, 2009, 10:38 PM posted to microsoft.public.access.queries
Anders
external usenet poster
 
Posts: 72
Default Looking for Existing Records

Howdy,

What type of expression do I create if I want to search a table (take
customers) to see if someone already exists? My customer table contains the
usual contact information. Everything I've seen on Help is setting the query
before hand (e.g. in the first name column, Like "Mar*" would return anybody
with Mar in the first name). I would love to find a way to have the user
define that criteria, but not have to setup a query.

Ideal world, the user clicks a button on the switchboard, then 3 consecutive
popup windows ask for the first three letters of 3 fields; first name, then
last name, then organization. Is this possible?

Greatly appreciated!

Anders
--
I''''ve encountered an error and I need to close for the weekend
  #2  
Old July 6th, 2009, 02:47 AM posted to microsoft.public.access.queries
Allen Browne
external usenet poster
 
Posts: 11,706
Default Looking for Existing Records

Use DLookup(). Like this:

Dim strWhere As String
dim varResult As Variant
strWhere = "(LastName = ""Jones"") AND (FirstName = ""Anders"")"
varResult = DLookup("ClientID", "tblClient", strWhere)
If Not IsNull(varResult) Then
MsgBox "Found! Client ID is " & varResult
End If

More info about DLookup() in:
Getting a value from a table: DLookup()
at:
http://allenbrowne.com/casu-07.html

--
Allen Browne - Microsoft MVP. Perth, Western Australia
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.

"Anders" wrote in message
news
Howdy,

What type of expression do I create if I want to search a table (take
customers) to see if someone already exists? My customer table contains
the
usual contact information. Everything I've seen on Help is setting the
query
before hand (e.g. in the first name column, Like "Mar*" would return
anybody
with Mar in the first name). I would love to find a way to have the user
define that criteria, but not have to setup a query.

Ideal world, the user clicks a button on the switchboard, then 3
consecutive
popup windows ask for the first three letters of 3 fields; first name,
then
last name, then organization. Is this possible?

Greatly appreciated!

Anders
--
I''''ve encountered an error and I need to close for the weekend


  #3  
Old July 6th, 2009, 01:51 PM posted to microsoft.public.access.queries
Tedmi
external usenet poster
 
Posts: 141
Default Looking for Existing Records

Matching names is more art than science, because of possible variations in
spelling. Are Jon Smith, Jonathan Smith and John Smith the same or different
persons?Here's the method I use for this:
Present a "New Customer" form, on which the user enters only the last name
of a supposedly new customer. Query the customer table and return all names
& addresses which match the input name. Ask the user if any of the displayed
names are the "new" customer; if not, have user click button which presents
a full customer entry form. Nice touch - have the last name transferred from
the new customer form to the full form.
-TedMi

"Allen Browne" wrote in message
...
Use DLookup(). Like this:

Dim strWhere As String
dim varResult As Variant
strWhere = "(LastName = ""Jones"") AND (FirstName = ""Anders"")"
varResult = DLookup("ClientID", "tblClient", strWhere)
If Not IsNull(varResult) Then
MsgBox "Found! Client ID is " & varResult
End If

More info about DLookup() in:
Getting a value from a table: DLookup()
at:
http://allenbrowne.com/casu-07.html

--
Allen Browne - Microsoft MVP. Perth, Western Australia
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.

"Anders" wrote in message
news
Howdy,

What type of expression do I create if I want to search a table (take
customers) to see if someone already exists? My customer table contains
the
usual contact information. Everything I've seen on Help is setting the
query
before hand (e.g. in the first name column, Like "Mar*" would return
anybody
with Mar in the first name). I would love to find a way to have the user
define that criteria, but not have to setup a query.

Ideal world, the user clicks a button on the switchboard, then 3
consecutive
popup windows ask for the first three letters of 3 fields; first name,
then
last name, then organization. Is this possible?

Greatly appreciated!

Anders
--
I''''ve encountered an error and I need to close for the weekend




 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 01:24 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.