Good Morning everyone:banghead:
I am creating a database for a non-profit veterans organization and I'm having a little trouble with the advanced security login form. The error started as an object not found, then syntax and compile error, now type mismatch.
Here is a copy of my code. I've looked in all the property sheets to try and find the mismatch. No Luck still can't seem to find it.
Private Sub LOGIN_ID_FORM2_Click()
Dim userlevel As Integer
Dim Userpassword As Integer
Dim Userlogin As String
Dim securityLVL As Integer
Dim password As Integer
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 JOB
If (IsNull(DLookup("[userlogin]", "Login", "[userlogin]= '" & Me.txtLoginID.Value & "'" And _
(IsNull(DLookup("[userPassword]", "Login", "[userPassword]= '" & Me.txtPassword.Value & "'")))))) Then
MsgBox "INVALID LOGIN ID OR PASSWORD"
Else
userlevel = (DLookup("[SecurityLVL]", "Login", "[UserLogin]= '" & Me.txtLoginID.Value & "'"))
DoCmd.Close
If userlevel = 1 Then
'MsgBox "LOGIN ID AND PASSWORD ARE CORRECT"
DoCmd.OpenForm "ADMIN FORM"
Else
DoCmd.OpenForm "SPLASH PAGE"
End If
End If
please, anyone, I would appreciate the help.
I am creating a database for a non-profit veterans organization and I'm having a little trouble with the advanced security login form. The error started as an object not found, then syntax and compile error, now type mismatch.
Here is a copy of my code. I've looked in all the property sheets to try and find the mismatch. No Luck still can't seem to find it.
Private Sub LOGIN_ID_FORM2_Click()
Dim userlevel As Integer
Dim Userpassword As Integer
Dim Userlogin As String
Dim securityLVL As Integer
Dim password As Integer
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 JOB
If (IsNull(DLookup("[userlogin]", "Login", "[userlogin]= '" & Me.txtLoginID.Value & "'" And _
(IsNull(DLookup("[userPassword]", "Login", "[userPassword]= '" & Me.txtPassword.Value & "'")))))) Then
MsgBox "INVALID LOGIN ID OR PASSWORD"
Else
userlevel = (DLookup("[SecurityLVL]", "Login", "[UserLogin]= '" & Me.txtLoginID.Value & "'"))
DoCmd.Close
If userlevel = 1 Then
'MsgBox "LOGIN ID AND PASSWORD ARE CORRECT"
DoCmd.OpenForm "ADMIN FORM"
Else
DoCmd.OpenForm "SPLASH PAGE"
End If
End If
please, anyone, I would appreciate the help.