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 SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Button_click events interfering with each other 1

Status
Not open for further replies.

PeDa

Technical User
Oct 10, 2002
227
0
0
NL
My form has various buttons. One button (button A) generates an Excel spreadsheet, saves it and e-mails it to a list of recipients. this whole process can take up to a minute. Other buttons perform various actions, which can involve changing or closing the tables button A uses. I had assumed that once button A has been pressed, the other buttons would remain unpressable until button A has finished. This is however not (always) the case. If my users accidentally press another button before button A is finished, an error can occur. In practice, telling the users not to press a button when the cursor is an hourglass is not sufficient. How can I effectively disable all the other buttons when one button is running?
 
Thank you Duane. This is indeed the solution. I should have thought about my last sentence better (How can I effectively DISABLE all the other buttons when one button is running?).

Peter
 
At the beginning of ButtonA click event you can loop thru all controls on your Form, and when you 'hit' any command button, set its Enabled property to False.

At the end of ButtonA click event you can loop thru all controls on your Form, and when you 'hit' any command button, set its Enabled property to True.


Have fun.

---- Andy

A bus station is where a bus stops. A train station is where a train stops. On my desk, I have a work station.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top