Results 1 to 6 of 6

Thread: Using A Command Button To Click Other Command Buttons using a time

  1. #1

    Thread Starter
    Member
    Join Date
    Jul 2008
    Posts
    57

    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

  2. #2
    Hyperactive Member
    Join Date
    Oct 2007
    Location
    Indiana
    Posts
    295

    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.

  3. #3

    Thread Starter
    Member
    Join Date
    Jul 2008
    Posts
    57

    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..

  4. #4
    Lively Member creek16's Avatar
    Join Date
    Mar 2009
    Posts
    107

    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!
    Discovery consists in seeing what everybody else has seen and thinking what nobody else has thought.
    - Albert Szent-Gy-rgi

  5. #5

    Thread Starter
    Member
    Join Date
    Jul 2008
    Posts
    57

    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....

  6. #6
    Lively Member creek16's Avatar
    Join Date
    Mar 2009
    Posts
    107

    Re: Using A Command Button To Click Other Command Buttons using a time

    look at this i hope you get the logic
    Attached Files Attached Files
    Last edited by creek16; Mar 16th, 2009 at 04:16 AM.
    Discovery consists in seeing what everybody else has seen and thinking what nobody else has thought.
    - Albert Szent-Gy-rgi

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width