Form Validation

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have a form with fields that are marked required in the table.

I would like the user to be able to hit "Cancel" when in data entry mode.
When the user hit cancel right now, and the required fields are not filled in
but other fields are, I get errors from access about the required fields not
filled in yet. The cancel button is on a main form, the form that is in data
entry mode is on a sub form. It's kinda like the subform is being saved when
the focus goes away??

I tried to setWarnings = False with no avail. Help would be greatly
appreciated!
 
Ibrahim said:
I have a form with fields that are marked required in the table.

I would like the user to be able to hit "Cancel" when in data entry mode.
When the user hit cancel right now, and the required fields are not filled in
but other fields are, I get errors from access about the required fields not
filled in yet. The cancel button is on a main form, the form that is in data
entry mode is on a sub form. It's kinda like the subform is being saved when
the focus goes away??


That's the correct behavior. Anytime the focus moves from a
main form to one of its subforms or vice versa the current
data must be saved. You could put the cancel button in the
subform to undo the record.

OTOH, you do not need a cancel button. Hitting the Esc key
twice will undo all canges made to the current record.
 
Back
Top