Cancel Buttons on Add Records

  • Thread starter Thread starter d9pierce
  • Start date Start date
D

d9pierce

Hi all,
I thought I was almost done but ran into a glitch :(

I have a bound form that loads from another form inserting some values
into this form. Everything works great and as I was testing this all
out, I found that my cancel button does not eliminate the new record if
I choose not to add and cancel it. It still creates a record.

It works fine for undo but is there something I can do to delete the
record created on click if in dataMode:=acFormAdd and not delete a
record in edit? Or maybe even create a new button just to undo and not
create a record when canceled?

I have tried many solutions but I am at a loss?

Please Help
Dave
d9pierce at mchsi dot com
 
Undo the record in your cancel button, i.e.:
If Me.Dirty Then Me.Undo
DoCmd.Close acForm, Me.Name

That will discard the record unless it is already saved. (There are lots of
things that could trigger Access saving it.)
 
Back
Top