You can't automatically close a message box after a time.
However, it's dead easy to create a little form that looks like a message
box, open it modally, and use its Timer event to close it.
1. Create a new unbound form, with a label control named (say) lblMsg.
2. Set these properties:
Popup: Yes
Modal: Yes
Timer Interval: 10000
On Load: [Event Procedure]
On Timer: [Event Procedure]
3. Click the Build button (...) beside the On Load property.
Access opens the code window.
Enter these 3 lines:
Private Sub Form_Load()
If Me.OpenArgs <> vbNullString Then
Me.lblMsg.Caption = Me.OpenArgs
End If
End Sub
4. Click the Build button (...) beside the On Timer property.
Access opens the code window.
Enter this line:
Private Sub Form_Timer()
DoCmd.Close acForm, Me.Name
End Sub
5. Save the form with a name such as fdlgMsg.
Now instead of MsgBox, call it like this:
DoCmd.OpenForm fdlgMsg, WindowMode:=acDialog, _
OpenArgs:="Now you see me; now you don't."
--
Allen Browne - Microsoft MVP. Perth, Western Australia
Reply to group, rather than allenbrowne at mvps dot org.
Tom said:
Hi
Am using Access 2002.
Is it possible to have a message box appear on screen, for say 10 sec,
and then automatically disappear?
If so how can that be achieved?
TIA
Tom