Me.Undo doesn't

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.
 
K

Ken Snell \(MVP\)

You cannot undo a record in the form's Close event. You must do this in the
form's BeforeUpdate event.
 
G

George Nicholson

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top