Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

How do you actuate a command button on another form...

How do you actuate a command button on another form...

How do you actuate a command button on another form...

I have a form that displays the time ticking by in a stopwatch format.  In order to start the action I have to press the "Start" command button which then of course turns into a "Stop" button.

After pressing a command button on my main form to run a certain long query I'd like to display this form with the stopwatch time slipping by and then when the query stops running, stop the timer and return to the main form.

I think that a SendKeys statement is necessary but haven't done one before.

thank you
Replies continue below

Recommended for you

RE: How do you actuate a command button on another form...

No need for SendKeys (and you should always avoid that anyway, because you can't control what window the keystrokes go to).

If your stopwatch form is called, say, StopWatch, and the command button is called cmdStartStop, you can simply call the button's Click procedure:

This doesn't exactly actuate the button, but it has almost the same effect. The difference is that other events, such as GotFocus, which would have occurred with a true actuation, won't be fired.

Rick Sprague

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members! Already a Member? Login

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close