Microsoft KB Archive/113298

= ACC: Unknown Reference or Function in Validation Expression =

Article ID: 113298

Article Last Modified on 1/18/2007

-

APPLIES TO


 * Microsoft Access 2.0 Standard Edition
 * Microsoft Access 95 Standard Edition
 * Microsoft Access 97 Standard Edition

-



This article was previously published under Q113298



Moderate: Requires basic macro, coding, and interoperability skills.



SYMPTOMS
When you try to save a table that has a field name, control name, or user- defined function in a validation rule or default value, you may receive the following error messages:

In Microsoft Access 97 you receive the following message:

The database engine does not recognize either the field ' ' in a validation expression, or the default value in table ''.

In Microsoft Access 2.0 or 7.0 you receive the following message:

Unknown or invalid reference ' ' in validation expression or default value in table ''.

  -or-

Unknown function ' ' in validation expression or default value in ''.



CAUSE
Validation rules are enforced by the Microsoft Access Jet database engine in Microsoft Access 2.0, 7.0 and 97. There are some rules allowed in Microsoft Access versions 1.0 and 1.1 that are not allowed at the field level in Microsoft Access 2.0, 7.0 and 97. In Microsoft Access 2.0, 7.0 and 97, validation rules at the field level cannot refer to other fields (whether in the current table or another table), controls on a form, or user-defined functions.



RESOLUTION
To get the validation rule you want, create the rule at the table level instead of the field level. Note that validation rules on a form can refer to other controls on the form.



STATUS
This behavior is by design.



Steps to Reproduce Behavior
 Start Microsoft Access and create a new database or open an existing one. Create a new table. Add two text fields named ABC and DEF to the table.</li>  Set the ValidationRule property of the DEF control to:

<pre class="fixed_text">     <[ABC] </li> Save the table (do not define a primary key). Note that you receive one of the error messages stated above.</li></ol>

Keywords: kberrmsg kbprb kbusage KB113298

-

[mailto:TECHNET@MICROSOFT.COM Send feedback to Microsoft]

© Microsoft Corporation. All rights reserved.