Cancelling a Record

D

DS

If you are halfway through entering a record and you decide to cancel,
what is the syntax for canceling all traces of the record?
Thanks
DS
 
A

Allen Browne

With the keyboard, press Esc twice.

With the Edit menu, choose Undo twice.

With the toolbar, click the Undo button twice.

In code, undo the form, i.e.:
Me.Undo
 
E

eddybarzoom

just press <escape>. You might lose an autonumber reference if you have one.
You can force the user to press <esc> by sutitable use of beforeupdate event.
 
S

Sharkbyte

There are a couple of options, depending on what method you are using to
update the table.

If you are using direct table entry, even with a form front-end, you can hit
the Esc key.

If you are using unbound fields, and then running an Insert command, simply
reset the fields to "". I find a Cancel button is very easily understood by
users.

There is also a Rollback statement, or something like it, that can be used
in code. I've never used it, but I did see it posted sometime last week.
Maybe someone can offer it here.

Good luck.

Sharkbyte
 
D

DS

Allen said:
With the keyboard, press Esc twice.

With the Edit menu, choose Undo twice.

With the toolbar, click the Undo button twice.

In code, undo the form, i.e.:
Me.Undo
Thank You, Allen.
DS
 
D

DS

eddybarzoom said:
just press <escape>. You might lose an autonumber reference if you have one.
You can force the user to press <esc> by sutitable use of beforeupdate event.


:
Thank You. I need to do it from a button on a form though. So i guess
it's Me.Undo
DS
 
D

DS

Sharkbyte said:
There are a couple of options, depending on what method you are using to
update the table.

If you are using direct table entry, even with a form front-end, you can hit
the Esc key.

If you are using unbound fields, and then running an Insert command, simply
reset the fields to "". I find a Cancel button is very easily understood by
users.

There is also a Rollback statement, or something like it, that can be used
in code. I've never used it, but I did see it posted sometime last week.
Maybe someone can offer it here.

Good luck.

Sharkbyte





:
Thank You....I'll be using Me.Undo.
DS
 
D

DS

Joseph said:
Note: you may well need to do a compact to totally eliminate all traces
of the record, although few users would even know it was there unless you
are using a non-random auto number.
I'm actually using the DMax function.
Thanks
DS
 
D

Dirk Goldgar

Sharkbyte said:
There is also a Rollback statement, or something like it, that can be
used in code. I've never used it, but I did see it posted sometime
last week. Maybe someone can offer it here.

The Rollback method is used in DAO or ADO when you have an explicit
transaction in progress. You can begin a transaction, make any number
of database updates, and then either Commit or Rollback your changes.
It wouldn't apply in this case, however.
 
Top