MsgBox, Save Changes, yes/no

Greyowlsl

Mlak Mlak
Local time
Tomorrow, 07:32
Joined
Oct 4, 2006
Messages
204
Hi,

I have a save button on a form. I need a piece of code so that when the user clicks the button the the command for that button will pause and bring up a textbox asking if they are sure they want to save changes. If they click yes then the code is unpaused and continues, if they click no then the code is stopped and the click command ignored.

This is the code i have for the button:
Code:
Private Sub Command44_Click()
'Save command:
    DoCmd.DoMenuItem acFormBar, acRecordsMenu, acSaveRecord, , acMenuVer70
'Refresh command:
    DoCmd.Close
    DoCmd.OpenForm "frmPCB"
End Sub

Thanks for your help,

Leon
 
Put this in the form's BeforeUpdate Event. Each time you change data on your form it should fire up & ask you if you want to save the record (data).
Good luck.

If MsgBox("Save Record Now?", vbYesNo, "Confirm Save") = vbYes Then
Else
Me.Undo
End If
 
Hey it worked, thanks.
 

Users who are viewing this thread

Back
Top Bottom