Adding records, duplicate found but can't delete it.

G

Guest

I have a simple DB, one table named "Students". The table has three fields:

studentID (unique, no duplicates, primary key)
firstName (obvious use)
lastName (obvious use)

I enter data and all seems to be well until I enter a duplicate studentID.
Of course, Access (2003 & 2007) complains about the duplicate and prompts me
to change the duplicate field. No problem. However, if I don't want to change
the "bad" record but only want to "delete" it and work on some other records
already in the table, Access will not let me do this. I must click on the
table's closebox, let Access chide me once again about the bad data, and
then, in the ensuing dialog, tell Access to close the table ("an error
occurred" which, of course, is the bad record (that hasn't even been saved!).

Do I actually have to do this in a form and set up some code to intercept
this so my users don't have to close the table if that make a simple mistake?
Why can't Access just let me delete this data (that isn't even a saved
record!).

Thanks in advance for any advice.
 
G

George Nicholson

Will hitting ESC a couple times "delete" the new record? This would be the
equivalent of 2 "Undo"s, which should do the trick on an unsaved record in
either table view or a simple form.

HTH,
 
G

Guest

George,

Yes, that seems to do the trick. I also read elsewhere that using Undo would
remove the erroneous record.

Thanks!
 

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

Top