Message Box

whitestone

Usually Confused
Local time
Today, 18:24
Joined
Oct 29, 2002
Messages
35
Hello All,

I'm am sure this is a very simple question once again. I have a Message Box that comes up from a Macro when you click a command box to exit the database saying 'Do you want to Exit?', the user can then click OK to exit the database. Is there any way to have yes and no boxes on this message rather than OK?

Sorry if this is really obvious......

Ben
 
Have a look at 'contents and index' under 'help' on the main menu and then look at msgbox function. You will find that you can use the argument in your code 'vbYesNo'. I am assuming that you just have 'vbOKOnly' at the moment. :)
 
Here's an example that lets you even use the question mark graphic.

If MsgBox ("Are you sure you want to exit?", vbQuestion + vbYesNo,"Exit Confirmation") = vbYes Then

Docmd.Quit

Else

Exit Sub

End If
 

Users who are viewing this thread

Back
Top Bottom