Pop-up form with a macro

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I am trying to have a pop-up form come up when i run a macro that has a long
process to say please wait. The form boarder comes on and the process runs,
however the form is like a clear window that i can see my existing form
behind it. Any ideas would be appreaciated.
 
RAO,

My guess is that the pop up form cannot complete because your process takes
over and the pop up can't get any cycle time to complete. If your process is
VBA code, then try putting in some Do Events statments to allow the pop up
time to complete.
 
thanks for the quick response! this sounds like whats going on because when
the macro finishes, the form fills in ok. my process is not in VBA code it
is all run in the macro. is there a way around this within the macro?
thanks again,
RAO
 
DoEvents is only available in VBA. Can you post the commands in your Maco?
It is possible we could find a place where you could do a runcode in a macro
and put a one liner sub to do this.
 
SetWarnings---Off
OpenQuery-----
(Open 9 different queries)
OpenReport
this macro runs 4 delete queries and 4 append queries and a query to run a
report.
I am not sure what you mean by run code in a macro and a one liner sub.
I tried having this macro call another macro to open a form with my message
and got the same results as before.
thanks,
rao
 
Ok, in your maco, before each query, insert a row. In each row, select the
RunCode Action. In the box where it asks for a function name, enter
"CycleEvents()"
Then, in a code module put this function:
Public Function CycleEvents() As Boolean
DoEvents
CycleEvents = True
End Function
Be sure you do it before each query. This should give you the result you want
 
i am getting an error 3218 which ms website had this to say: "This error
occurs when a user tries to save a record that is locked by another user. To
handle this error, program your solution to wait for a short period of time,
and then try to save the record again. Or, you can display a message that
explains the problem and give users the opp'y to try the operation again".

i cam across this thread using a search string of "vba wait" thinking
someone may have run across a situation where they use vba to get the system
to temporarily pause/wait for some pre-specified interval or just somehow
perform some innocuous non-task. i don't quite understand the code you wrote
but i gathered that it's intended to fulfill the latter. am i rong :-)
 
Ted,
Read RAO's original post. He was having a problem with a message box not
displaying correctly when he launched a macro that runs several queries. I
don't know that this has solved his problem, he has not said so. What the
intention here is to allow time for the message box to be completely painted.
What the DoEvents statement does is to release control to the OS so if other
tasks are waiting, they will have some processing time. This is a nice
(polite) thing to do if you are executing procedures that do a lot of data
interaction. You may have seen some apps where the monitor would hesitate
and jump and you would have trouble getting the computer to respond to your.
Putting a DoEvents in whatever loop you are doing allows other processes and
applications a turn to do something.
 
klaatu,

thanks for the explan'....i did some further trolling through the litany of
responses and found one that was perhaps a bit more 'on point' that spoke to
a sleep command i plan to try.

best,

-ted
 
this works!!
thank you for your quick professional response.
it's people like you that make this post a success.
thanks again
rao
 
Yay! This works!

Klatuu said:
Ok, in your maco, before each query, insert a row. In each row, select the
RunCode Action. In the box where it asks for a function name, enter
"CycleEvents()"
Then, in a code module put this function:
Public Function CycleEvents() As Boolean
DoEvents
CycleEvents = True
End Function
Be sure you do it before each query. This should give you the result you want
 
Back
Top