Solved Syntax Error (1 Viewer)

hucheunghugo

New member
Local time
Today, 21:51
Joined
Apr 11, 2022
Messages
23
Code:
    If IsNull(DLookup("Staff_ID", "Login", "LoginID = '"&Me.ID&"' and Password = '"&Me.PW&"'")) Then

    End If
I find a login form example video on the Internet and i change the name of text box and field name
But it shows that there are syntax error.....
 
Last edited:

GinaWhipp

AWF VIP
Local time
Today, 09:51
Joined
Jun 21, 2011
Messages
5,899
Your Form name has spaces, change to...

Code:
DoCmd.OpenForm "[Movie Info 1]"

Hmm, is Me.ID a number?
 

cheekybuddha

AWF VIP
Local time
Today, 14:51
Joined
Jul 21, 2014
Messages
2,274
Code:
    If IsNull(DLookup("Staff_ID", "Login", "LoginID = '" & Me.ID & " AND Password = '" & Me.PW & "'")) Then

    End If
 

cheekybuddha

AWF VIP
Local time
Today, 14:51
Joined
Jul 21, 2014
Messages
2,274
Code:
                                                             Error here
                                                                |
                                                                V
    If IsNull(DLookup("Staff_ID", "Login", "LoginID = '"&Me.ID&"' and Password = '"&Me.PW&"'")) Then

    End If
 

cheekybuddha

AWF VIP
Local time
Today, 14:51
Joined
Jul 21, 2014
Messages
2,274
You have a control called 'ID'?

The field in the table is 'Staff_ID'?

If so, then your original code (in Post #1) looks OK. Perhaps add the spaces between the '&', but the VBA editor should do that for you anyway.
 

Users who are viewing this thread

Top Bottom