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

Flexibility: how to get to code when computer freezes when form opens

Status
Not open for further replies.

gstrenio

Programmer
Oct 6, 2002
9
US
Hello forum:
I have been working on a Flexibilty module where I have a "SendKeys" VBA statement on the Got focus event of the first field that receives the focus when the form opens.
I had used "SendKeys" with no parameter, but tried "SendKeys, True" to see if setting WAIT = true would work more consistently. Now program freezes when form opens, and I can't get to VBA editor to change it back. Do I have to delete the whole project and start over, or is there a way to edit the code behind the screen before it opens? Thanks
George
 
Sign into Macola with a user name that will not invoke the flexibility code, than change the code to solve your locking problems.

Software Sales, Training, Implementation and Support for Exact Macola, eSynergy, and Crystal Reports
 
Hi George,

Unfortunately Don's solution will not work, because if you are logged in as a user that does not invoke your code you can not see the code. However you can press the Alt+Pause|Break key combo. Once you open the screenset and things lock up, just hold down the "Alt" key and press the Pause/Break key in the upper right hand side of your keyboard. You can also use this keycombo as the screenset is opening to prevent the code from ever executing. In this scenario you would hold down the "Alt" key and quickly tap the Pause/Break key as the screenset opens. Under both scenarios this will halt execution of your code and allow you to open the code editor.

In addition, if you are looking for more consistent results from the SendKeys function, I would suggest making a small executable that acts like the SendKeys function, by taking the Key Combo as a parameter and calling the SendKeys function from within your standalone app. I have a small program that I would be happy to send to you that does this. You can reach me at scott @nexosystems.com (Please remove the space before sending).

Good Luck,
Scott Travis
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top