ACC: Unknown Reference or Function in Validation Expression

Last reviewed: May 7, 1997
Article ID: Q113298
The information in this article applies to:
  • Microsoft Access versions 2.0, 7.0, 97

SYMPTOMS

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

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 '<field>' in a
   validation expression, or the default value in table '<Table>'.

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

   Unknown or invalid reference '<field>' in validation expression or
   default value in table '<Table>'.

   -or-

   Unknown function '<function>' in validation expression or default value
   in '<Table>'.

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.

MORE INFORMATION

Steps to Reproduce Behavior

  1. Start Microsoft Access and create a new database or open an existing one.

  2. Create a new table.

  3. Add two text fields named ABC and DEF to the table.

  4. Set the ValidationRule property of the DEF control to:

          <[ABC]
    

  5. Save the table (do not define a primary key). Note that you receive one of the error messages stated above.


Keywords : kberrmsg kbusage TblDsign
Version : 2.0 7.0 97
Platform : WINDOWS
Hardware : X86
Issue type : kbprb
Resolution Type : Info_Provided


THE INFORMATION PROVIDED IN THE MICROSOFT KNOWLEDGE BASE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. MICROSOFT DISCLAIMS ALL WARRANTIES, EITHER EXPRESS OR IMPLIED, INCLUDING THE WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL MICROSOFT CORPORATION OR ITS SUPPLIERS BE LIABLE FOR ANY DAMAGES WHATSOEVER INCLUDING DIRECT, INDIRECT, INCIDENTAL, CONSEQUENTIAL, LOSS OF BUSINESS PROFITS OR SPECIAL DAMAGES, EVEN IF MICROSOFT CORPORATION OR ITS SUPPLIERS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. SOME STATES DO NOT ALLOW THE EXCLUSION OR LIMITATION OF LIABILITY FOR CONSEQUENTIAL OR INCIDENTAL DAMAGES SO THE FOREGOING LIMITATION MAY NOT APPLY.

Last reviewed: May 7, 1997
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.