Blacktronics wrote:Hi there i making a file store with a password but it only counts 1 and stops i can click at the button like a ...

i am using VB6
- Code: Select all
Private Sub Command2_Click()
If Text1.Text = "9999999" Then
End
Else
Counter = Counter + 1
Text2.Text = (Counter)
End If
If Text2.Text = "5" Then
MsgBox "Account is Locked"
Text1.Enabled = False
End If
End Sub
Private Sub Form_Load()
Dim Count As Integer
Counter = 0#
End Sub
I know this is an old topic but no one has given a useful solution.
Well first of Blacktronics you aren't specifying the Counter variable in the correct place. Count is specified in Form_Load but its not needed so you can delete it.
Declare
Dim Counter As Integer in the Declaration section of the code window. Thats right at the top under Option Explicit when you decide to use it.
You aren't using
Option Explicit either because that would have told you that error. If you don't know what it does or how to set it up then just ask.
