Advertisement
Guest User

Untitled

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