Create a new form in design view. Put a label on the form to contain the
message. Click on the label, and open the Properties window; select the
Format tab. Put your desired message in the label's Caption property.
Now, keep the Properties window open. Click on the area beyond the edge of
the form. The Properties window should now be "active" for the form. Click
on the Event tab. Scroll down to the Timer Interval property. Identify how
many seconds you want the form to remain displayed, multiply that by 1000,
and put that number in this box (replace the 0 that is already there); for
example, if you want the form to be open for 5 seconds, put 5000 in that box
(5000 is the number of milliseconds that you want the form to be open).
Then, go to the On Timer property. Click in the box and select [Event
Procedure]. Then click on the three-dot box at far right side of the
textbox. The Visual Basic Editor will open and display two lines separated
by a blank line:
Private Sub Form_Timer()
End Sub
On the blank line, type this:
DoCmd.Close acForm, Me.Name, acSaveNo
Then close the VBE window, save the form (name it frmMsgBox or something
like that).
Now, when your macro opens this form, it will close automatically. Be sure
that you open the form using the Window Mode of Dialog.
--
Ken Snell
<MS ACCESS MVP>
dvonj said:
I have not been successful in figuring out how to do this. Could you
explain
the steps to make it happen. I read a lot of stuff in the MS help file but
nothing seems to work for me.