Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

DLOOKUP QUESTION

Status
Not open for further replies.

gma800

Programmer
Feb 9, 2002
4
0
0
US
I need help on a Dlookup;

here is my problem:

1. My database is currently in MS Access 2000

2. I created a FORM also using MS Access 2000, wherein the data encoder must enter a name, like John Doe

3. I created a TABLE also using MS Access 2000, wherein it contains a list of names that must not be entered.

4. I created a macro using the DLookup condtition , I used this entry:
Dlookup([name],[tblnoentry],"[name] like form.[frm_itmName]") is not null

purpose is that if the frm_itmName has a match in the name field of the tblNOentry, it will run the macro and a message will inform the user of a match.

Problem:
When the user enters the name in a different order like last name first, while what was stored is firstname first like Doe John, it was not checked by the Dlookup.

what do you think must I do to caputure the name in any order is will be written.

 
- Take the users input and break it into two variables
- ie var1 = John var2 = Doe
- Your macro then tests the two variables in dirrent combinations
ie: var3 = var2 + " " + var 1 AND THEN var3 = var1 + " " + var2

Have fun !! PC
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top