Advertisement
Guest User

Untitled

a guest
Feb 7th, 2017
118
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.55 KB | None | 0 0
  1. Private Sub Form_Load()
  2. intClickCount = 1
  3.  
  4. udtNewUser.StrUserName(1) = "Jack"
  5.  
  6. udtNewUser.StrUserName(2) = "Jack"
  7.  
  8.  
  9. udtNewPassword.intUserPasscode(1) = 6688
  10. udtNewPassword.intUserPasscode(2) = 8899
  11.  
  12.  
  13. blnValid = False
  14.  
  15. End Sub
  16.  
  17. Private Sub NameValidation(ByVal varUserName As Variant)
  18.  
  19. Dim intLoopIndex As Integer
  20.  
  21. If varUserName = "" Then
  22.  
  23. MsgBox "Please enter your user name in the box"
  24.  
  25. txtUserCode.SetFocus
  26.  
  27.  
  28. Else
  29.  
  30. For intLoopIndex = 1 To 10
  31.  
  32. If varUserName = udtNewUser.StrUserName(intLoopIndex) Then
  33.  
  34.  
  35. MsgBox "Name Found"
  36.  
  37. txtUserCode.Text = ""
  38.  
  39. Label1.Caption = "Now Please Enter your password"
  40.  
  41. intFoundIndex = intLoopIndex
  42.  
  43.  
  44. blnValid = True
  45.  
  46. Exit For
  47.  
  48.  
  49. Else
  50.  
  51. MsgBox "Wrong Name. Please Try Again"
  52.  
  53. txtUserCode.Text = ""
  54. txtUserCode.SetFocus
  55.  
  56. Exit For
  57.  
  58.  
  59. End If
  60.  
  61. Next intLoopIndex
  62.  
  63. End If
  64.  
  65. End Sub
  66.  
  67. Private Sub PasswordValidation(ByVal varUserPassword As Variant, ByVal intFoundIndex As Integer)
  68.  
  69. If varUserPassword = "" Then
  70.  
  71. MsgBox "Wrong password. Please try again"
  72.  
  73. ElseIf varUserPassword = udtNewPassword.intUserPasscode(intFoundIndex) Then
  74.  
  75.  
  76. MsgBox "Password accepted."
  77.  
  78. ElseIf intClickCount < 3 Then
  79.  
  80. MsgBox "Wrong password. Please try again."
  81. intClickCount = intClickCount + 1
  82.  
  83. Else
  84.  
  85. MsgBox "You have tried three times without success. The system will now exit."
  86. End
  87.  
  88. End If
  89.  
  90. End Sub
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement