Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Exit Button with a message 1

Status
Not open for further replies.

molly

Technical User
Jul 17, 2000
219
US
I have a good EXIT button working, however, I would like to add an event message such as "Are you sure that you want to exit the file?". I would like to stay with an Access event code and not a fancy module. Something simple for me.

I presently use an On Click Event:

Private Sub cmdEXIT_Click()

DoCmd.Quit

End Sub


Thanks
Molly
 
It is simple enough to add a message:

Code:
Private Sub cmdEXIT_Click()
If MsgBox("Are you sure?",vbYesNo)=vbYes Then
   DoCmd.Quit
End if
End Sub
 
Remou - long time no hear ! Love your work.
Thanks for the tip. It works real nice.

Here is one for you.

Private Sub cmdEXIT_Click()
If MsgBox("Is Remou terrific?",vbYesNo)=vbYes Then
DoCmd.Quit
End if
End Sub

And I will always answer "Y".

Molly
 
Molly,
Code:
Private Sub cmdEXIT_Click()
    Do While MsgBox("Is Remou terrific?", vbYesNo) <> vbYes
    Loop
End Sub

________________________________________________________
Zameer Abdulla
Help to find Missing people
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top