Syntax Error in DLookup()

Triscuit

Registered User.
Local time
Today, 16:11
Joined
Jul 20, 2010
Messages
27
Compile Error
Expected: list seperator or )

On the first line.


Code:
   DLookup("usrID","tblUsers", "[txtFName] = '" &Me.txtFName& "' "_
    & "AND [txtMInitial] = '" & Me.txtMInitial & "' " _
    & "AND [txtLName] = '" & Me.txtLName & "' ")

Can anyone point this out for me?
 
The line continuation is a space and an underscore. You missed the space.
 
Thank you for the response and made the change but the same error appears.

When the compile error comes up it highlights the red part

DLookup(" usrID","tblUsers", "[txtFName] = '" &Me.txtFName& "' " _
& "AND [txtMInitial] = '" & Me.txtMInitial & "' " _
& "AND [txtLName] = '" & Me.txtLName & "' ")
 
Found the error needed spaces around the &Me.txtFName&
goes to & Me.txtFName &
 
Well, you've got what I assume is an extra space in your field name, and no spaces between the ampersands and the form reference.
 

Users who are viewing this thread

Back
Top Bottom