If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
Wait for form load then have VBA trigger a button.
Ok, I am having a hard time with this. Access 2007 I have a button that
takes an image of the form and makes it a pdf. Now I need to automate this, the form loads quite a few queries and displays it. The problem is I keep getting this error : "This action can't be carried out while processing a form or report event." So now I have to figure out how to wait for form to finish loading and then change focus and then trigger button. I've tried all kinds of different patterns macros, timers, modules etc... Just unable to figure out how to execute when form is finished loading. The button works perfectly fine when I go in and manually click it so I know the internal code is working fine, just the load form and trigger isn't. So I am looking for any new or fresh ideas on getting this button to trigger after the form loads. I know reports are better, but this form also displays variable information for user to change info if necessary. -- Message posted via AccessMonster.com http://www.accessmonster.com/Uwe/For...forms/201004/1 |
#2
|
|||
|
|||
Wait for form load then have VBA trigger a button.
Here is one suggestion (untested):
1.Try using a separate form with a button. Open form with button. On its current event, -Put code to open the form with the queries. -Then a call to DoEvents (just DoEvents on one line). -Then a call to the code on the form with queries, that creates the pdf. If that doesn't help, try using WithEvents to tell the form with the button that the form with the queries has finished loading. See help for WithEvents. Jeanette Cunningham MS Access MVP -- Melbourne Victoria Australia "Hoardling1 via AccessMonster.com" u43783@uwe wrote in message news:a631f9b0c104c@uwe... Ok, I am having a hard time with this. Access 2007 I have a button that takes an image of the form and makes it a pdf. Now I need to automate this, the form loads quite a few queries and displays it. The problem is I keep getting this error : "This action can't be carried out while processing a form or report event." So now I have to figure out how to wait for form to finish loading and then change focus and then trigger button. I've tried all kinds of different patterns macros, timers, modules etc... Just unable to figure out how to execute when form is finished loading. The button works perfectly fine when I go in and manually click it so I know the internal code is working fine, just the load form and trigger isn't. So I am looking for any new or fresh ideas on getting this button to trigger after the form loads. I know reports are better, but this form also displays variable information for user to change info if necessary. -- Message posted via AccessMonster.com http://www.accessmonster.com/Uwe/For...forms/201004/1 |
#3
|
|||
|
|||
Wait for form load then have VBA trigger a button.
IT WORKED!!!!
Thank You Thank You Thank You!!!!!!! Jeanette Cunningham wrote: Here is one suggestion (untested): 1.Try using a separate form with a button. Open form with button. On its current event, -Put code to open the form with the queries. -Then a call to DoEvents (just DoEvents on one line). -Then a call to the code on the form with queries, that creates the pdf. If that doesn't help, try using WithEvents to tell the form with the button that the form with the queries has finished loading. See help for WithEvents. Jeanette Cunningham MS Access MVP -- Melbourne Victoria Australia Ok, I am having a hard time with this. Access 2007 I have a button that takes an image of the form and makes it a pdf. Now I need to automate [quoted text clipped - 18 lines] information for user to change info if necessary. -- Message posted via http://www.accessmonster.com |
Thread Tools | |
Display Modes | |
|
|