Msg Box

brsawvel

Registered User.
Local time
Yesterday, 22:21
Joined
Sep 19, 2007
Messages
256
This is my first time trying to use a msg box.

How do I write code to display a msg box asking, "Are you sure you want to exit without saving?".

If the person selects yes, then the form is exited.

If the person selects no, then the form remains open.
 
search for "msgbox" in VBE help
its really detailed

If you get stuck post back
 
DCB,

I believe in figuring it out yourself too, but just in case he cant...

Spoiler alert!!

example below!!:p (Highlight)

If MsgBox("You have not saved your record. Would you like to save first?", vbYesNo + vbQuestion) = vbYes Then
MsgBox "Please click save"
Exit Sub
Else
End If
 
DCB,

I believe in figuring it out yourself too, but just in case he cant...

Spoiler alert!!

example below!!:p (Highlight)

If MsgBox("You have not saved your record. Would you like to save first?", vbYesNo + vbQuestion) = vbYes Then
MsgBox "Please click save"
Exit Sub
Else
End If
Now come on that's not nearly enough
 
mmmm Rich
I know that it is sometimes so hard to find stuff in the help file if you dont know the keyword you are looking for - try type in [msgbox function] in the search box and the result is at the bottom of the page....

I always assume that is what the OP really wants ;)

So why dont we paste the vbconstants while we're at it? :D :eek: :D
 
You sure? ;)

Next time we want to see every line commented including a procedure header containing all the enum's used by the function with their description - That answer "You sure?" ?
 
Next time we want to see every line commented including a procedure header containing all the enum's used by the function with their description - That answer "You sure?" ?

Haha will do!
 
mmmm Rich
I know that it is sometimes so hard to find stuff in the help file if you dont know the keyword you are looking for - try type in [msgbox function] in the search box and the result is at the bottom of the page....

I always assume that is what the OP really wants ;)

So why dont we paste the vbconstants while we're at it? :D :eek: :D

He wouldn't find out in the Help file how to prevent the update if users didn't want to save the record via the Msg box function, as for searching help I came under a great deal of personal abuse on this forum from a so called Mod for not giving enough information when answering posts preferring just to give a nudge in the right direction;)
 
That bit would do nicely and where should the function be placed within the form, which event etc

I merely gave an example on how to use the input from a message box...
 
, as for searching help I came under a great deal of personal abuse on this forum from a so called Mod for not giving enough information when answering posts preferring just to give a nudge in the right direction;)
Thats unfortunate - Thats all I assume anyone is really wanting....
In the spirit of my signature I have learnt so much from looking for something in the help file and finding another 5 "mental notes"
 
No need to pop a message box unless you are first verifying if the record is Dirty!
 
No need to pop a message box unless you are first verifying if the record is Dirty!
True
The poor OP when they check back .... they are going to be "Dazed and Confused" to put it mildly
 
True
The poor OP when they check back .... they are going to be "Dazed and Confused" to put it mildly
And what to do if the user just pushes the form close button in the corner:D
 

Users who are viewing this thread

Back
Top Bottom