i have a button and a check box
if i tick the check box i want to run that button repeatedly
can any body help me???
Printable View
i have a button and a check box
if i tick the check box i want to run that button repeatedly
can any body help me???
Welcome to the Forums.
You could drop a Timer contro on to your form and set its Interval property to the interval you want the button click procedure to run. Then in the Timer event you would just call the click event of the button.
So how would you stop or cancel the operation. :D
Code:Option Explicit
Private Sub Check1_Click()
Timer1.Interval = 1000 '1 second
If Check1.Value = vbChecked Then
Timer1.Enabled = True
Else
Timer1.Enabled = False
End If
End Sub
Private Sub Timer1_Timer()
Call Command1_Click
End Sub
Private Sub Command1_Click()
'Do something
End Sub
thanks ma bro :D
No prob. Glad to help. :)
Ps, as a newer member we like to Resolve our threads here so others know our questions have been answered. You can do this from the Thread Tools menu > Mark Thread as Resolved. ;)
Edit: neveermind as I see you already resolved it. Cool, usually it takes new members a bit to find it or have someone tell them :thumb: