G Guest Nov 30, 2005 #1 Hi! Kindly help me how to stop save/update records when I close/exit my access form. Thanks for any help. KRISH
Hi! Kindly help me how to stop save/update records when I close/exit my access form. Thanks for any help. KRISH
G Guest Nov 30, 2005 #2 In Access's default, when you exit form or go to another record, record will auto saved if edit or add new From my experience in develop Access Application, i will make 2 buttons in the form. i.e. SAVE and CANCEL for SAVE: Docmd.RunCmd acSaveRecord for CANCEL: Me.Undo Docmd.Close "KRISH" 來函:
In Access's default, when you exit form or go to another record, record will auto saved if edit or add new From my experience in develop Access Application, i will make 2 buttons in the form. i.e. SAVE and CANCEL for SAVE: Docmd.RunCmd acSaveRecord for CANCEL: Me.Undo Docmd.Close "KRISH" 來函:
A Allen Browne Nov 30, 2005 #3 If you want to ask the user before any save, use the BeforeUpdate event of the form: Private Sub Form_BeforeUpdate(Cancel As Integer) If MsgBox("Save?", vbOkCancel, "Confirm entry") <> vbOk Then Cancel = True 'Me.Undo End If End Sub Note that this will trigger regardless of how the save was going to occur.
If you want to ask the user before any save, use the BeforeUpdate event of the form: Private Sub Form_BeforeUpdate(Cancel As Integer) If MsgBox("Save?", vbOkCancel, "Confirm entry") <> vbOk Then Cancel = True 'Me.Undo End If End Sub Note that this will trigger regardless of how the save was going to occur.