Visual Basic 6: After 5 tries display a message (password program)?

Hi i'm making a password program for my programming class, and im done but the second part is to have an error/msgbox come up after 5 tries, i don't know how to do it, i've attempted to but i've failed, this is what i have right now

*********************************************************************************************************

Private Sub cmdOK_Click()

Const secretPassword As Integer = 1234

Dim guess As Integer

guess = Val(txtPassword.Text)

If guess = secretPassword Then

MsgBox ("Password Accepted")

Else

txtCheck = ("Incorrect Password-Please try again!")

End If

If txtPassword.Text = "1234" Then

Form2.Show

End If

End Sub

Please enter comments
Please enter your name.
Please enter the correct email address.
You must agree before submitting.

Answers & Comments


Helpful Social

Copyright © 2024 QUIZLS.COM - All rights reserved.