Form data entry - how do you cancel arecord insert?

  • Thread starter Thread starter wazza_c12
  • Start date Start date
W

wazza_c12

Hi There

Last (simple) database I created I had the main entry form unbound, so
that a user hit an "add entry" button, and an isert query was called...
This avoided records being written until user had put all details in a
form and decided to add it.

I'm now embarking on a more complex relational database project and
fear if I go the same path as before it may cause issues like I am
unable to access what the autonumber primary key is of a record that
was just inserted etc.

Would that be a problem? Is there an easier way to go about all this?

If I have a bound form, and halfway through filling it out the user
decides they dont want to do that operation anymore .... how does one
go about canning a half entered record?

Cheers

Warwick
 
You can use Me.Undo which will work for either a new record or to reverse any
changes made to an existing record. I usually include a command button on my
forms with the caption CANCEL and put that line of code in the Click event.
 
I'd do it the way you did the previous one. Because you're not writing
to the table until you press the "add entry" button, there's no record
locking in place. It's easier than using me.undo, which I've used at
times with mixed success.
 
I would have to disagree. Unbound forms require a lot more code. The Undo
method is reliable if you do it correctly.
 
Back
Top