Simple NULL Validation

  • Thread starter Thread starter Joe Williams
  • Start date Start date
J

Joe Williams

What is the simplest way to make sure a user has filled in certain fields on
a form prior to saving? I don't want certain fields to have NULL in them

I have the table's fields REQUIRED setting = yes, but that gives a rather
ugly error message.

Is there an easier way to do this validation prior to saving a form?

THanks
 
Hi Joe

Use the Form_BeforeUpdate event procedure.

If IsNull( LastName) Then
LastName.SetFocus
MsgBox "Please enter the customer's last name"
Cancel = True
Exit Sub
End If
.... check other fields.
 
Back
Top