you cannot add or change a record

  • Thread starter Thread starter Rick A
  • Start date Start date
R

Rick A

The user can add some data to a form but decide not to finish. They click the close button, the "X" in the upper right hand corner. How do I trap for this and if something is entered on the form ignore it.

I'm receiving the error "You cannot add or change a record because...". Referential integrity is turned on and the form is complaining.

While I'm at it, what's the code to turn off this message?

Thanks,
 
Hi Rick,

the first time you press ESCape, it undoes changes to the
fireld you are in

if the field is not the first one you have changed, press
ESCape again to undo changes to the record

Have an awesome day

Warm Regards,
Crystal

MVP Microsoft Access

remote programming and training
strive4peace2006 at yahoo.com
 
Crystal,

I could ask the user to hit the ESC key first but that's not intuitive. The
user clicks the close button and I need to trap for this error. How do I do
that?
 
if me.dirty then me.undo


Have an awesome day

Warm Regards,
Crystal

MVP Microsoft Access

remote programming and training
strive4peace2006 at yahoo.com
 
Back
Top