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
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