When your query encounters a constraint violation, by default Microsoft Access displays a message from Microsoft SQL Server. If your Access project is connected to a SQL Server 2000 database, you can create and show a more user-friendly message using the Validation Text property.
If the constraint expression is: | Type the validation text: |
---|---|
MinJobLevel > 10 |
"The job level is too low. You must enter a number greater than 10." |
HouseholdName Is Not Null |
"Please enter a household name." |
Quantity >= 0 |
"You must enter a positive number." |
Note The Validation Text property is ignored in an unbound form that fills in control values directly from ADO. In this case, you must trap the error and display the validation text in your code.