Deleting a record, I think

  • Thread starter Thread starter Dr. Brad
  • Start date Start date
D

Dr. Brad

Good morning,

I am using Windows XP Pro and access XP Pro (2003).

When I use an input form that I've created I sometimes get halfway through
the form and say "oh hell, I'm tired!" At this point I reach for the small
x at the top of the window and close the form.

This doesn't always work well! Sometimes fields are left "unfilled" and so
they complain. I can use the On Close event and bypass these problems.
However, I always end up with a "partially completed" record.

What is the easiest way to get rid of the record that is only partially
complete??

Brad
 
Thanks Allen for the suggestion. However, this still leaves me with a blank
record in the table!
Is there some way that I can code a Delete Record in the One Close event??
Brad
 
Pressing Esc once undoes the field. Pressing Esc again undoes the record. If
you still get the blank new record after doing this, the new record must
have already been saved at the time you tried to undo it.

To prevent saving a completely blank record, the simplest solution would be
to mark one of the fields as required. Open the table in design view. Select
a suitable field. In the lower pane of table design, set the Required
property to Yes. Access will now be unable to save the record unless you
entered something into this field.

Alternatively, you could cancel the BeforeUpdate event of the *form* (not
control.)

The Close and Unload events are too late: the bad record would already have
been saved, and may no longer be the current record.
 
Back
Top