I have a save record button on a form. The problem is that a message box pops up asking is you want to update the record. If you select yes everything is fine, if you select no however, all of the data on the form is cleared.
What I need is when you select no for the data to remain in all of the controls, just dont write the data to the table.
The code I have now in the click event is:
Private Sub cmdSave_Click()
On Error GoTo Err_cmdSave_Click
DoCmd.DoMenuItem acFormBar, acRecordsMenu, acSaveRecord, , acMenuVer70
DoCmd.GoToRecord , , acNewRec
Exit_cmdSave_Click:
Exit Sub
Err_cmdSave_Click:
MsgBox Err.Description
Resume Exit_cmdSave_Click
End Sub
What I need is when you select no for the data to remain in all of the controls, just dont write the data to the table.
The code I have now in the click event is:
Private Sub cmdSave_Click()
On Error GoTo Err_cmdSave_Click
DoCmd.DoMenuItem acFormBar, acRecordsMenu, acSaveRecord, , acMenuVer70
DoCmd.GoToRecord , , acNewRec
Exit_cmdSave_Click:
Exit Sub
Err_cmdSave_Click:
MsgBox Err.Description
Resume Exit_cmdSave_Click
End Sub