A Microsoft Office (Excel, Word) forum. OfficeFrustration

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.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Using Forms
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Wait for form load then have VBA trigger a button.



 
 
Thread Tools Display Modes
  #1  
Old April 7th, 2010, 11:55 PM posted to microsoft.public.access.forms
Hoardling1 via AccessMonster.com
external usenet poster
 
Posts: 24
Default 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  
Old April 8th, 2010, 01:01 AM posted to microsoft.public.access.forms
Jeanette Cunningham
external usenet poster
 
Posts: 2,190
Default 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  
Old April 8th, 2010, 03:35 PM posted to microsoft.public.access.forms
Hoardling1 via AccessMonster.com
external usenet poster
 
Posts: 24
Default 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

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 04:52 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.