Confirm update message box

rbrule

Registered User.
Local time
Today, 03:14
Joined
Jan 13, 2004
Messages
108
I would like to have an update (requery) button on my form, that when clicked opens a message box that asks "ARE YOU SURE YOU WANT TO UPDATE?", if yes, a yes button is pushed, which requeries the record and closes the message box. If a no button is pushed, the message box is closed without requerying the record.

Can someone walk me through the process?
 
In the On_Click event of your requery button just but:

If MsgBox("Are you sure you want to requery this record?", vbOKCancel + vbQuestion, "Confirm Requery") = vbOK Then
'your update or requery code goes here
End If
 
Last edited:
Thank you Meltdown, it worked great. Is it possible to change the color of the background of the message box?
 
No you can't change the background color of the message box that access creates. If you want more control, you need to customise a form and make it look like a message box...see attachment.
 

Attachments

Thank you, I appreciate your help.

rbrule
 

Users who are viewing this thread

Back
Top Bottom