Advertisement
Guest User

Untitled

a guest
Apr 21st, 2017
98
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.12 KB | None | 0 0
  1. Dim user As String
  2. Dim password As String
  3. Dim user1 As String
  4. Dim password1 As String
  5. Static failed As Integer
  6.  
  7. user = LCase(Me.txtUser.Text)
  8. password = LCase(Me.txtPassword.Text)
  9. user1 = "curtis"
  10. password1 = "gabor"
  11.  
  12. If user = user1 And password = password1 Then
  13. MsgBox("login successful")
  14. Application.Exit()
  15. End If
  16.  
  17. If user <> user1 And password = password1 Then
  18. MsgBox("user ID is Incorrect")
  19. Me.txtUser.Text = ""
  20. failed = failed + 1
  21. End If
  22.  
  23. If user = user1 And password <> password1 Then
  24. MsgBox("password is Incorrect")
  25. Me.txtPassword.Text = ""
  26. failed = failed + 1
  27. End If
  28.  
  29. If user <> user1 And password <> password1 Then
  30. MsgBox("Incorrect login and password")
  31. Me.txtUser.Text = ""
  32. Me.txtPassword.Text = ""
  33. failed = failed + 1
  34. End If
  35.  
  36. If failed = 3 Then
  37. MsgBox("Sorry, access denied!")
  38. Application.Exit()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement