Help with Message Box

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

Guest

I have a form with 2 required fields. When the user tabs through the form to
reach the next record, but leaves the required fields blank, the system
messge box comes up with a message informing the user that "In the field
"Table.Exists' cannot contain a Null value because the Required property for
this field is set to True. Enter a value in this field." I need to change
the wording of this message box to something more user friendly like "Please
enter yes or no in the Exists field." Can anyone help on this? (I only work
with Access every couple of months and seem to forget what I knew the last
time)

Thanks
 
Use the Error event of the form, and trap DataErr 3314.

Alternatively, open the table in design view.
Turn off the field's Required property.
Set the field's Validation Rule to Is Not Null.
Enter whatever message you want as the Validation Text.
 
Sorry - here's my ignorance - How do I code the Is Not Null - I can't find
any reference to it in the expression builder?
 
Oops - got the Is Not Null but it doesn't work. It allows me to go to the
next record without asking for a yes or no.
 
What data type is this field?

If it's a Yes/No field, Access defaults to no. You can select Yes, but it
cannot be null.
 
I got it - I misread your instructions and thought I was to do the validation
on the form, not in the table. I did as you said for the fields in the table
and it works perfectly! Thanks a million
 
Back
Top