Can anyone help with my variable please!?

DogFingers
04-23-2003, 10:31 AM
Hi, here is my code.


Option Explicit
Dim wrongcounter As Integer

----

Private Sub answerlist_Click()
If answerlist.Text = "Radio" Then
wrongcounter = wrongcounter + 1
Do Until wrongcounter = 3
Loop
MsgBox "Whoops!"
imgunhappy.Visible = True
End If

----

But everytime I click on Radio after i click it 3 times no messagebox comes up!?any ideas, thx

martin

JDYoder
04-23-2003, 10:42 AM
You're going to hit an endless loop the first time in.

crabby
04-23-2003, 10:44 AM
Private Sub answerlist_Click()
If answerlist.Text = "Radio" Then wrongcounter = wrongcounter + 1
if wrongcounter = 3 then
wrongcounter = 0
MsgBox "Whoops!"
imgunhappy.Visible = True
End If

DogFingers
04-23-2003, 10:56 AM
Thanks, that worked great :)

EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum