Trying to close a form with a command button in a way that any data in the fields is not saved to the table.
In the OnClick event for cmdClose, I have the following code:
[BEGIN CODE]
Private Sub cmdClose_Click()
On Error GoTo Err_cmdClose_Click
DoCmd.Close , , acSaveNo
Exit_cmdClose_Click:
Exit Sub
Err_cmdClose_Click:
MsgBox Err.Description
Resume Exit_cmdClose_Click
End Sub
[END CODE]
When I created the OnClick code, I used the 'acSaveNo' option, thinking the data wouldn't be saved when cmdClose is clicked. But the data is being saved anyway.
What's the easiest way to close a form with cmdClose without the data being saved?
In the OnClick event for cmdClose, I have the following code:
[BEGIN CODE]
Private Sub cmdClose_Click()
On Error GoTo Err_cmdClose_Click
DoCmd.Close , , acSaveNo
Exit_cmdClose_Click:
Exit Sub
Err_cmdClose_Click:
MsgBox Err.Description
Resume Exit_cmdClose_Click
End Sub
[END CODE]
When I created the OnClick code, I used the 'acSaveNo' option, thinking the data wouldn't be saved when cmdClose is clicked. But the data is being saved anyway.
What's the easiest way to close a form with cmdClose without the data being saved?