Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Private Sub Form_Load()
- intClickCount = 1
- udtNewUser.StrUserName(1) = "Jack"
- udtNewUser.StrUserName(2) = "Jack"
- udtNewPassword.intUserPasscode(1) = 6688
- udtNewPassword.intUserPasscode(2) = 8899
- blnValid = False
- End Sub
- Private Sub NameValidation(ByVal varUserName As Variant)
- Dim intLoopIndex As Integer
- If varUserName = "" Then
- MsgBox "Please enter your user name in the box"
- txtUserCode.SetFocus
- Else
- For intLoopIndex = 1 To 10
- If varUserName = udtNewUser.StrUserName(intLoopIndex) Then
- MsgBox "Name Found"
- txtUserCode.Text = ""
- Label1.Caption = "Now Please Enter your password"
- intFoundIndex = intLoopIndex
- blnValid = True
- Exit For
- Else
- MsgBox "Wrong Name. Please Try Again"
- txtUserCode.Text = ""
- txtUserCode.SetFocus
- Exit For
- End If
- Next intLoopIndex
- End If
- End Sub
- Private Sub PasswordValidation(ByVal varUserPassword As Variant, ByVal intFoundIndex As Integer)
- If varUserPassword = "" Then
- MsgBox "Wrong password. Please try again"
- ElseIf varUserPassword = udtNewPassword.intUserPasscode(intFoundIndex) Then
- MsgBox "Password accepted."
- ElseIf intClickCount < 3 Then
- MsgBox "Wrong password. Please try again."
- intClickCount = intClickCount + 1
- Else
- MsgBox "You have tried three times without success. The system will now exit."
- End
- End If
- End Sub
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement