|
-
May 26th, 2001, 01:51 PM
#1
Thread Starter
Member
2 line Validation Situation .... HELP....plz!!!!
Hey,
I'm trying to set up a validation behind a text box in access and I want it to find certain values in a table. Unfortuantly I am having a problem with this piece of code a few lines long:
I am trying to perform a procedure which checks whether a customer in a table already exists by comparing First, Last Name and Post Code. Unfortunatly I have a probelm in the FirstName variable. This is what I have tried:
FirstName = DLookup("FName", "CustomerInfo", "[CustomerInfo]![CustID] = LCustomerID")
Where
LCustomerID = DLookup("CustID", "CustomerInfo", "[CustomerInfo]![LName] = Forms![Add_Customer]![txtLName]")
But this did not work So I tried this:
FirstName = DLookup("FName", "CustomerInfo", "[CustomerInfo]![CustID] =(DLookup("CustID", "CustomerInfo", "[CustomerInfo]![LName] = Forms![Add_Customer]![txtLName]"))")
Still does not work
Can anyone help me with this problem? I will be very greatful
-
May 26th, 2001, 02:03 PM
#2
PowerPoster
Can you stop cross-posting (in General VB and Database Dev). Also you posted the same question twice in each forum within about 15 minutes of each other. If nobody knew the first time, they aren't going to know the second time. Don't hog space, we don't need 4 posts asking the same thing.
As for your request, this is wrong.
Code:
FirstName = DLookup("FName", "CustomerInfo", "[CustomerInfo]![CustID] = LCustomerID")
It should be
Code:
FirstName = DLookup("FName", "CustomerInfo", "[CustomerInfo]![CustID] = " LCustomerID)
(no quotes around numbers!!)
-
May 26th, 2001, 02:24 PM
#3
Thread Starter
Member
error message: expected list or separator
LcustomerID highlighted?????
-
May 26th, 2001, 03:15 PM
#4
PowerPoster
In that case try
Code:
FirstName = DLookup("FName", "CustomerInfo", "[CustomerInfo]![CustID] = " & LCustomerID
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|