Can fields on a form require data be entered before moving on?

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

Guest

I want all fields in a form filled in. Is there a way to prevent people from
just hitting the tab key, leaving the field blank and moving to the next
field?
 
you can add code to each control's Exit event to check for data. but usually
it's more user-friendly to allow the user to move about a form at will, and
check for required data in the *form* BeforeUpdate event. you can also set
the Required property for specific fields directly in a table's design view.
Access will automatically kick an error message at the form level if the
user attempts to save a record with data missing from a required field;
however, it's a pretty ugly message, so you'd probably want to trap the form
error and substitute your own message via code.

hth
 
Fran,

In addition to Tina's excellent advice, an alternative approach is to go
to the design view of the table, and set the Validation Rule property of
each affected field to Is Not Null, and then enter a suitable message to
display to the user in the Validation Text property.
 
Back
Top