Advertisement
Guest User

Untitled

a guest
Feb 10th, 2019
157
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.  
  2. Option Compare Database
  3.  
  4. Private Sub txtLoginID_Click()
  5. If IsNull(Me.txtLoginID) Then
  6.     MsgBox "Please enter LoginID", vbInformation, "LoginID required"
  7.     Me.txtLoginID.SetFocus
  8. ElseIf IsNull(Me.txtPassword) Then
  9.     MsgBox "Please enter password", vbInformation, "Password Required"
  10.     Me.txtPassword.SetFocus
  11. Else
  12.     'process the job
  13.    If (IsNull(DLookup("UserLogin", "Users", "UserName ='" & Me.txtLoginID.Value & "'"))) Or _
  14.     (IsNull(DLookup("password", "Users", "Password ='" & Me.txtPassword.Value & "'"))) Then
  15.         MsgBox "Incorrect LoginID or Password"
  16.     Else
  17.     MsgBox "Login and Password correct"
  18.     DoCmd.OpenForm "mainmenu"
  19.     End If
  20. End If
  21.  
  22. End Sub
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement