MsgBox

  • Thread starter Thread starter alex
  • Start date Start date
A

alex

Hello experts,

Is there a way to code a msgbox to flash on the screen and then go
away.
I coded MsgBox "Record Saved", but it promts the user to click ok.
I'd like the message 'Record Saved' to just flash, without user
intervention.

alex
 
That is the way msgbox works.

Only way I can think of to get it to close is to put an ontimer event
in there to close itself and have the event triggered after 5 or 10
seconds.

Be advised though that while is it there the msgbox has control and
focus.

Ron
 
No, the MsgBox will not do that. You need to create your own form, display
that form, and then use that form's Timer event to close itself.
 
No, the MsgBox will not do that. You need to create your own form, display
that form, and then use that form's Timer event to close itself.

--

Ken Snell
<MS ACCESS MVP>








- Show quoted text -

Thanks guys for your comments
 
Hello experts,

Is there a way to code a msgbox to flash on the screen and then go
away.
I coded MsgBox "Record Saved", but it promts the user to click ok.
I'd like the message 'Record Saved' to just flash, without user
intervention.

alex

No, but you could create your own unbound form with your message and
have it display for just a few seconds and then disappear.

Set the Form's Timer Interval to 1000

Then code the form like this:

Option Compare Database
Option Explicit
Dim dteTime As Date
======
Private Sub Form_Load()
dteTime = Time()
End Sub
=====
Private Sub Form_Timer()
If DateDiff("s", dteTime, Time()) >= 2 Then
DoCmd.Close acForm, Me.Name
End If
End Sub
 
No, but you could create your own unbound form with your message and
have it display for just a few seconds and then disappear.

Set the Form's Timer Interval to 1000

Then code the form like this:

Option Compare Database
Option Explicit
Dim dteTime As Date
======
Private Sub Form_Load()
dteTime = Time()
End Sub
=====
Private Sub Form_Timer()
If DateDiff("s", dteTime, Time()) >= 2 Then
DoCmd.Close acForm, Me.Name
End If
End Sub

Thanks Fred for taking the time to help.

alex
 
Back
Top