Kode

You might also like

Download as txt, pdf, or txt
Download as txt, pdf, or txt
You are on page 1of 1

Private Sub Command1_Click()

Dim UserLevel As Integer


If IsNull(Me.txtLoginID) Then
MsgBox "Please Enter Login ID", vbInformation, "Login ID 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 Login ID or Password"
Else
UserLevel = DLookup("UserSecurity", "tblUser", "UserLogin = '" &
Me.txtLoginID.Value & "'")
DoCmd.Close
If UserLevel = 1 Then
'MsgBox "Login ID and Password Correct"
DoCmd.OpenForm "Navigation Form"
Else
DoCmd.OpenForm "Customer"
End If
End If
End If
End Sub

You might also like