Hi Bret
The Code below will give you a timed msgbox
Just use it like a normal msgbox with the typical options....only Diff is that you set the time it displays for.
Have a play with it....
Ivan
'---------------------------------------------------------------------------------------
' Module : CodeTimer
' DateTime : 12/01/02 14:33
' Author : Ivan F Moala
' Note:
' Office 97 does not support the "AddressOf" operator which is needed to tell Windows
' where our "call back" function is.
'
' Inputs :
' Outputs :
'---------------------------------------------------------------------------------------
Option Explicit
Declare Function SetTimer Lib "user32" (ByVal hwnd As Long, ByVal nIDEvent As Long, _
ByVal uElapse As Long, ByVal lpTimerfunc As Long) As Long
Declare Function KillTimer Lib "user32" (ByVal hwnd As Long, ByVal nIDEvent As Long) As Long
'==========Public Declarations ==============================
Public TimerID As Long 'Turn on and off with this ID
Public TimerActive As Boolean 'Is the timer active
Public Const tmMin As Long = 2 'Min time allowed
Public Const tmDef As Long = 5 'Default if min set low
'============================================================
Public Sub ActivateMyTimer(ByVal Sec As Long)
Sec = Sec * 1000
If TimerActive Then Call DeActivateMyTimer
On Error Resume Next
TimerID = SetTimer(0, 0, Sec, AddressOf Timer_CallBackFunction)
TimerActive = True
End Sub
Public Sub DeActivateMyTimer()
KillTimer 0, TimerID
End Sub
Sub Timer_CallBackFunction(ByVal hwnd As Long, ByVal uMsg As Long, ByVal idevent As Long, _
ByVal Systime As Long)
Application.SendKeys "~", True
If TimerActive Then Call DeActivateMyTimer
End Sub
Function TmMsgBox(sMsg As String, Btn As VbMsgBoxStyle, Optional ShowFor As Long, _
Optional sTitle As String) As VbMsgBoxResult
'If no Title then default to App Title
If sTitle = "" Then sTitle = Application.Name
'If showfor < minimum time then set to default
If ShowFor < tmMin Then ShowFor = tmDef
'Call Timer
ActivateMyTimer ShowFor
TmMsgBox = MsgBox(sMsg, Btn, sTitle)
DeActivateMyTimer
End Function
Sub aTest()
Dim Answer
Answer = TmMsgBox("Is this OK?", vbYesNo + vbDefaultButton1, , "Data Entry check")
'>> rest of your code if required
End Sub