login button not working

gracedLiz

New member
Local time
Today, 16:19
Joined
Apr 24, 2014
Messages
5
Hello,
I'm new to access, I'm using access 2007 and I have created a login form and the button title "login" doesn't seem to work with the code that I got from someone's site. I have tried going through the code a couple of times, but still nothing, please help

this is the code:

If IsNull(Me.txtLoginID) Then
MsgBox "Please enter LoginID", vbInformation, "LoginID Required"
Me.txtLoginID.SetFocus
ElseIf IsNull(Me.txtPassword) Then
MsgBox "Please enter Password", vbInformation, "Password Required"
Me.txtPassword.SetFocus
Else
'process the job
If (IsNull(DLookup("UserLogin", "tblUser", "UserLogin='" & Me.txtLoginID.Value & "'"))) Or _
(IsNull(DLookup("Password", "tblUser", "Password='" & Me.txtPassword.Value & "'"))) Then
MsgBox "Incorrect LoginID or Password"
Else
'MsgBox "LoginID and Password correct"
DoCmd.OpenForm "Ambassadors"
End If
End Sub

Thanks
 
Okay. I'll do that. Thank you
 
Hello again, I've created a new button and pasted the code but it's still the same thing. So not sure what to do next.
 
I have tried it again, Im getting an error message saying: "compile error:method or data member not found. It is also opened a full code for the command button in visual basic
 

Attachments

Users who are viewing this thread

Back
Top Bottom