Mandatory Fields - Problem

  • Thread starter Thread starter Ang
  • Start date Start date
A

Ang

Hi,

I set the mandatory fields and must enter some information and no way to get
out but when I use "ESC" and the mandatory fied 's msgbox disappeared.

How do I block "ESC" till fill some information on Mandatory Fields first.

Your help would be apprecated.
Thanks
 
Pressing <Esc> undoes the entry. The result is the same as just tabbing
through the required field without typing anything.

In general, it's not a good interface to force the user to enter data in
every field, in order, before they can move on. You can cancel the control's
Exit event if the value IsNull(), but it's a horrid interface work with, and
you still have no guarantee that the user will ever visit each control. For
example, if I fill in control #1, and click on #3, I never did visit #2 to
its Exit event was not fired, so the field can still be blank.

The only way to check for this is:
1. Set the Required property of the appropriate fields to Yes in the table
so Access won't save the record until there is an entry, or
2. Use the BeforeUpdate event of the *form* to check for the fields that
should not be Null.

Use #1 when you never want a field to be saved if it is blank.
Use #2 when you want to question whether it should be blank, but allow the
user to override the warning.
 
Back
Top