Close MsgBox

  • Thread starter Thread starter dbl
  • Start date Start date
D

dbl

Hi I have a report when on no date it displays a MsgBox is it possible to
code the MsgBox to close say after say 5 seconds without using the OK
button? (I do want to keep the message.)

If so how do go about it setting it up.

Thanks Bob
 
dbl said:
Hi I have a report when on no date it displays a MsgBox is it possible to
code the MsgBox to close say after say 5 seconds without using the OK
button? (I do want to keep the message.)

If so how do go about it setting it up.

Thanks Bob
I've done popups by creating a form with the message, and using the
TIMER INTERVAL event, coding if for 5000 (millisecs) and then issuing
the CloseForm (macro or vba) on the ONTIMER event.
 
You'll need to create your own "MsgBox". To do this, create a form and set
it up to look like a message box. You would have the report open this form
using the acDialog window mode argument in the DoCmd.OpenForm call. This
will cause the code to pause until the popup form is closed or hidden, just
as the code pauses when you open a MsgBox. Since you are using a form, you
would then use the Timer Event of the form to have it close itself after the
desired time.
 
Hello Wayne,
I will give that try, thanks Bob
You'll need to create your own "MsgBox". To do this, create a form and
set it up to look like a message box. You would have the report open
this form using the acDialog window mode argument in the
DoCmd.OpenForm call. This will cause the code to pause until the popup
form is closed or hidden, just as the code pauses when you open a
MsgBox. Since you are using a form, you would then use the Timer Event
of the form to have it close itself after the desired time.
 
Back
Top