Guys,
Thanks again, the DLookup is now working, however I am rendering a
"type mismatch" error
Here is the code:
If Me.Login_PW = DLookup("Staff_Password", "Security_Staff",
"[Staff_Name]= '" & Me.LogIn_ID & "'") Then
Staff_Name = Me.LogIn_ID
The debugger is pointing to "Staff_Name = Me.LogIn_ID"
Me.LogIn_ID is a string
-M
Damian S wrote:
Hi Mr.Kane,
Try opening the immediate window (Ctrl-G) and typing
? DLookup("Staff_Password", "Security_Staff", "[Staff_ID]= '" & Me.LogIn_ID
& "'")
(including the question mark), and that will let you know if the dlookup
portion is working correctly. You may need to replace the me.LogIn_ID with
forms!frmName.LogIn_ID, and ensure that you have the form open.
Damian.
:
Alright guys,
Apparently I have been working way too long on this and just overlooked
the "source" table.
I now have the correct table but am coming across the "Expected list
separator or )" error again.
Here is the current code:
If Me.Login_PW = DLookup("Staff_Password", "Security_Staff",
"[Staff_ID]= '" &Me.LogIn_ID& "'")
This code segment is highlighted by the debugger: &Me.LogIn_ID& "'")
(the double quotes, single quote, double quotes portion)
I am baffled.
-M
Mr.Kane wrote:
Damian and David,
Thank you for taking the time out to offer a solution. David's Syntax
suggestion
DLookup("Staff_Password", "Staff", "[Staff_ID]= Me.LogIn_ID")
seems to have done the trick, however now I am encoutering the
following error:
Run-Time error '2471'
'the object doesn't contain the Automation object 'Staff_Password."
Any help would be appreciated
-M
David F Cox wrote:
It is perhaps the wrong hour of the morning to be trying to use my brain,
but:
DLookup("Staff_Password", "Staff", "[Staff_ID]= Me.LogIn_ID")
Hi Mr.Kane,
If login_ID is a number, you do not need the extra quotes at all... If it
is a string, try using a single quote like this:
DLookup("Staff_Password", "Staff", "[Staff_ID]='" & Me.LogIn_ID & "'")
You might also want to consider checking for null in case you have no
matching Staff in the table with the entered Staff_ID. Also, just to
prevent
confusion, if you are calling it Staff_ID in the table, why not call it
Staff_ID on your form also for consistency.
Hope this helps.
Damian.
where after the equals sign is a single quote then double quote, then
after
the ampersand is a double quote, single quote, double quote.
:
I am creating a login form and keep running into the same compile
error: "Expected: List separator or )"
Here is the offending code segment:
If Me.Login_PW = DLookup("Staff_Password", "Staff", "[Staff_ID]='"
&Me.LogIn_ID& ""')Then
Staff_Name = Me.LogIn_ID.Value
The highlighted segment of code are the 2 double quotes after
&Me.LogIn_ID&
I'm sure the correct syntax will be obvious after the fact but it's
incredibly frustrating right now.
any help would be appreciated
I am willing to send anyone who can help a screenshot of the error for
your evaluation. I believe
that I have the order correct but it may help you to see the error and
the highlighted code segment.
Thank you,
Marc