i get another error in a different place: "Compile error: invalide use of property"
Private Sub Command1_Click()
Dim UserLevel As String
Dim TempPass As String
Dim ID As Integer
Dim TempLoginID As String
If IsNull(Me.txtLoginID) Then
MsgBox "Please Enter LoginID", vbInformation, "LoginID Required"
Me.txtLoginID.SetFocus
ElseIf IsNull(Me.txtPassword) Then
MsgBox "Please Enter Your Password", vbInformation, "Password Required"
Me.txtPassword.SetFocus
Else
'process the job
If (IsNull(DLookup("[UserLogin]", "tblUser", "[UserLogin] ='" & Me.txtLoginID.Value & "' And password = '" & Me.txtPassword.Value & "'"))) Then
MsgBox "Invalid LoginID or Password"
Else
TempLoginID = Me.txtLoginID.Value
UserName = DLookup("UserName", "tblUser", "UserLogin ='" & Me.txtLoginID.Value & "'")
UserLevel = DLookup("UserSecurity", "tblUser", "UserLogin ='" & Me.txtLoginID.Value & "'")
TempPass = DLookup("Password", "tblUser", "UserLogin ='" & Me.txtLoginID.Value & "'")
ID = DLookup("UserID", "tblUser", "UserLogin ='" & Me.txtLoginID.Value & "'")
DoCmd.Close
If (TempPass = "password") Then
MsgBox "Please Change your Password", vbInformation, "New Password Required!"
DoCmd.OpenForm "ChangesNewPassword", , , "[UserID]=" & ID
Else
If UserLevel = "Admin" Then
'MsgBox "LoginID or Password Correct"
DoCmd.OpenForm "Navigation Form"
Form! [Navigation Form]![txtLogin] = TempLoginID
Form! [Navigation Form]![txtUser] = LoginID
Else
DoCmd.OpenForm "frmlRequisitionOrder"
End If
End If
End If
End If
End Sub
Private Sub Command1_Click()
Dim UserLevel As String
Dim TempPass As String
Dim ID As Integer
Dim TempLoginID As String
If IsNull(Me.txtLoginID) Then
MsgBox "Please Enter LoginID", vbInformation, "LoginID Required"
Me.txtLoginID.SetFocus
ElseIf IsNull(Me.txtPassword) Then
MsgBox "Please Enter Your Password", vbInformation, "Password Required"
Me.txtPassword.SetFocus
Else
'process the job
If (IsNull(DLookup("[UserLogin]", "tblUser", "[UserLogin] ='" & Me.txtLoginID.Value & "' And password = '" & Me.txtPassword.Value & "'"))) Then
MsgBox "Invalid LoginID or Password"
Else
TempLoginID = Me.txtLoginID.Value
UserName = DLookup("UserName", "tblUser", "UserLogin ='" & Me.txtLoginID.Value & "'")
UserLevel = DLookup("UserSecurity", "tblUser", "UserLogin ='" & Me.txtLoginID.Value & "'")
TempPass = DLookup("Password", "tblUser", "UserLogin ='" & Me.txtLoginID.Value & "'")
ID = DLookup("UserID", "tblUser", "UserLogin ='" & Me.txtLoginID.Value & "'")
DoCmd.Close
If (TempPass = "password") Then
MsgBox "Please Change your Password", vbInformation, "New Password Required!"
DoCmd.OpenForm "ChangesNewPassword", , , "[UserID]=" & ID
Else
If UserLevel = "Admin" Then
'MsgBox "LoginID or Password Correct"
DoCmd.OpenForm "Navigation Form"
Form! [Navigation Form]![txtLogin] = TempLoginID
Form! [Navigation Form]![txtUser] = LoginID
Else
DoCmd.OpenForm "frmlRequisitionOrder"
End If
End If
End If
End If
End Sub
Last edited: