Open Form - Do Stuff - Close Form

treva26

Registered User.
Local time
Today, 02:01
Joined
Sep 19, 2007
Messages
113
I have a form which is basically just a progress bar.

I have the code set to run on Form_Current

But my DoCmd.Close command at the end causes an error saying
"this action cant be carried out while processing a form event"


I can't figure out what event to put my code in so it executes as soon as the form is loaded, then is able to automatically close the form..
 
I have a form which is basically just a progress bar.

I have the code set to run on Form_Current

But my DoCmd.Close command at the end causes an error saying
"this action cant be carried out while processing a form event"


I can't figure out what event to put my code in so it executes as soon as the form is loaded, then is able to automatically close the form..

Put it in the On Load event of the form.
 
what about putting the close event in a timer - the problem with putting it in a normal event, is that it may just flick on and off

i now avoid making users press a button to close a form, by opening it, so they can see some info, waiting for 5 secs say, and then closing it in the timer event
 
Consider keeping any processing code that has nothing to do with the progress bar form outside of the form; else you may find yourself, over time, building a new "progress bar form" for each process that requires a progress bar.

That is...from outside the progress bar form, create and call a common routine to open and close the progress bar form, calling another routine in between these calls to do whatever processing you're doing...

Code:
' Pseudo code.
  Open generic progress bar
  Do stuff
  Close generic progress bar
Regards,
Tim
 

Users who are viewing this thread

Back
Top Bottom