Cancelling a Record

  • Thread starter Thread starter DS
  • Start date Start date
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
 
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
 
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.
 
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
 
DS said:
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

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

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

Similar Threads

Canceling Records 9
Access Dcount (multiple criteria) 3
Recordset.clone record count issue 3
Better way to auto number 4
Rundll Error 0
On Exit Event 2
get out of control 5
Suppress MsgBox 7

Back
Top