Me.Undo doesn't

  • Thread starter Thread starter NetworkTrade
  • Start date Start date
N

NetworkTrade

Access2002 with a popup form that is going to be closed with the red X in its
corner.

The record is dirty Put into the On Close Event

If IsNull(ImportantField) Then
Me.Undo
end if

Am still getting a record created

tried putting in:
If IsNull(ImportantField) Then
DoCmd.Close acForm, "MyPopUp", acSaveNo
end if
but that throws an error that the action is canceled.
 
You cannot undo a record in the form's Close event. You must do this in the
form's BeforeUpdate event.
 
DoCmd.Close acForm, "MyPopUp", acSaveNo

FYI: "acSaveNo" refers to saving changes to the Form itself, not any bound
data that might be on the form
 
Back
Top