Using A Command Button To Click Other Command Buttons using a time
hello guys...
i have a problem
i have 5 command button
Command01
Command02
Command03
Command04
Command05
i want when i press Command01, automatically
run Command02, in 5 second,
then after 5 second click Command03
then after 5 second click Command04
then after 5 second click Command05
can anybody help me in it...
best regs
Re: Using A Command Button To Click Other Command Buttons using a time
First, make your command buttons a control array. So they become Command1(0), Command1(1), Command1(2) etc.
In your form's declaration section declare a variable to be used as a counter. Such as dim MyCounter as integer
Set your timer control for 5 seconds (5000 ms)
Your Command1(0) event should be to enable the timer.
In your timer event, have it increment the counter, then click the command button for that counter.
MyCounter=MyCounter+1
Command1(Mycounter)_Click
if MyCounter=4 then timer1.enabled=false
This should get you started.
Re: Using A Command Button To Click Other Command Buttons using a time
bro... i dnt want to create a arrey
so can u tel me another way i can do it..
Re: Using A Command Button To Click Other Command Buttons using a time
then create a function that contains the each command code
then call them, done!
Re: Using A Command Button To Click Other Command Buttons using a time
creek i dnt get what u said...
can u explain it lill more....
1 Attachment(s)
Re: Using A Command Button To Click Other Command Buttons using a time
look at this i hope you get the logic