Simple NULL Validation

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
 
G

Graham Mandeno

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top