Display a message box for a set amount of time

CBragg

VB Dummy
Local time
Today, 20:34
Joined
Oct 21, 2002
Messages
89
Ive got a form with a graphic as a way to exit my application as apposed to a button.

When they click the xit button i want a message box to appear saying "Exiting, please wait..." for about 2 seconds then dissapear before the appilication closes down.

Is it a wait function?? I havent the foggiest.

Any ideas would be helpfull.

Thanks,
 
Code:
Private Sub MyImage_Click()
    MsgBox "Please wait, exiting", vbInformation, "My App"
    Me.TimerInterval = 2000
End Sub

Private Sub Form_Timer()
    DoCmd.Quit
End Sub

That'll give a message box and once OK is clicked it'll shut the app down after two seconds.

If you want what you described then you need to make a small form with your message on it, and on the click of your image open the form as a dialog. Set the small form's TimerInterval to 2000 and use the code above for the Timer event.
 
thanks, but that doesnt seem to close unless i click the ok button??
Also, is there a way of hiding the ok button??
 
As I said, you'll need to click the OK button but then I suggested what you would have to do without a message box (you can't hide their buttons). Create a form that looks like a message box and fix its TimerInterval to 2000, and then copy the OnTimer code I gave.
 

Users who are viewing this thread

Back
Top Bottom