Display, then Close MsgBox

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

Guest

I have a process that takes a while to complete. I want access to display a
MsgBox that says "Please wait while process completes . . .", and then
automatically close the MsgBox when the process completes, without the user
having to click a button (OK, Cancel, etc). How can I code this?
 
Create a small unbound for that looks like a message box. You can pass the
message, display the form, finish your procedure and close the form.

Set the form's Popup property to Yes, but Modal property to No. This allows
it to float over other forms, but does not prevent the code from executing
(as a MsgBox does.)

Put a text box on the form, with control source of:
=[Form].[OpenArgs]
Save it with a name such as "fdlgMsgbox".

Then in your code:
DoCmd.OpenForm "fdlgMsgbox", OpenArgs:="Please wait"
'your long process here
DoCmd.Close acForm, "fdlgMsgbox"
 
The form appears on the screen, but doesn't have time to fully appear before
the process starts running. In other words, it only partically appears and
the message itself isn't displaying. Is there a simply "Pause" or "Wait"
function that I can invoke to give the form time to fully appear before the
process starts running?
 
Try adding:
With FormsfdlgMsgbox
.Recalc
.Repaint
End With

If that still doesn't work, try:
DoEvents
after the Recalc, and before the Repaint.
 
Back
Top