C
CW
I have a form where we add new debtor records.
It has a Save button which works fine when a new record has been created. It
saves the record and closes the form.
It also has a Close button which should close the form WITHOUT saving
anything that has been entered, such as when the user decides to abort for
some reason. However, at the moment it does save and create a new record in
the underlying table. How can I prevent this, i.e. get it to do a close and
NOT save?
I am using the code shown below, on the Click event of the Close button.
Many thanks
CW
Private Sub DebtorFormCloseBtn_Click()
On Error GoTo Err_DebtorFormCloseBtn_Click
DoCmd.Close
Exit_DebtorFormCloseBtn_Click:
Exit Sub
Err_DebtorFormCloseBtn_Click:
MsgBox Err.Description
Resume Exit_DebtorFormCloseBtn_Click
End Sub
It has a Save button which works fine when a new record has been created. It
saves the record and closes the form.
It also has a Close button which should close the form WITHOUT saving
anything that has been entered, such as when the user decides to abort for
some reason. However, at the moment it does save and create a new record in
the underlying table. How can I prevent this, i.e. get it to do a close and
NOT save?
I am using the code shown below, on the Click event of the Close button.
Many thanks
CW
Private Sub DebtorFormCloseBtn_Click()
On Error GoTo Err_DebtorFormCloseBtn_Click
DoCmd.Close
Exit_DebtorFormCloseBtn_Click:
Exit Sub
Err_DebtorFormCloseBtn_Click:
MsgBox Err.Description
Resume Exit_DebtorFormCloseBtn_Click
End Sub