Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

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

Status
Not open for further replies.

e7akerson

Technical User
Nov 17, 2000
19
0
0
US
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
 
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:
Form_StopWatch.cmdStartStop_Click

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
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top