remove a row without squaking about constraint violations

E

esharris

In MS Access 2003, I have a form that is bound to a table that has a field
that requires data entry.

Suppose I use the form to add a row and then decide to delete the row. If I
close the form before adding something to the required field, I get an error
message that complains about the Null value in the required field. Somewhere
in there a "before update" event is triggered.

IMHO, it doesn't make sense to update the row (and trigger error messages)
before deleting the row. If I don't want the row, I don't care if the row
would have violated a constraint, if I chose to update it.

How can I get the program to remove the row without squaking about the null
value in the required field?
 
M

MikeB

In MS Access 2003, I have a form that is bound to a table that has a field
that requires data entry.

Suppose I use the form to add a row and then decide to delete the row. If I
close the form before adding something to the required field, I get an error
message that complains about the Null value in the required field. Somewhere
in there a "before update" event is triggered.

IMHO, it doesn't make sense to update the row (and trigger error messages)
before deleting the row. If I don't want the row, I don't care if the row
would have violated a constraint, if I chose to update it.

How can I get the program to remove the row without squaking about the null
value in the required field?

I think that by hitting "Esc" you can back out the change. Is that
what you're asking?
 
P

Pete D.

The problem is you have a dirty record and access thinks it should save what
changes you have made but it can't as you are missing a required field. You
have to undo the new/changed record your not going to save. Most get around
this by putting thier own close, undo, don't save buttons on the form to
make it more intuitive for the user.
 
J

John W. Vinson

How can I get the program to remove the row without squaking about the null
value in the required field?

Hit the <Esc> key twice before closing the form.

The reason for the gripe is that Access will (try to) save the record on
closing the form.
 

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