ACC: "Undefined Function" Error Referencing Combo Box Column

Last reviewed: November 25, 1997
Article ID: Q141617
The information in this article applies to:
  • Microsoft Access versions 2.0, 7.0, 97

SYMPTOMS

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

In Microsoft Access, you may receive the following error message if you refer to the Column property of a combo box in a query's criteria row (query by form):

   Undefined function '[Forms]![FormName]![ComboBoxName].[Column]' in
   expression.

CAUSE

Microsoft Access tries to parse the criteria expression at the "(" (opening parenthesis). When doing so, Microsoft Access concludes that the unbroken string preceding the "." (period) (and returned within single quotation marks in the error message) is a user-defined function. Because Microsoft Access finds no such function in any of your modules, you receive the "Undefined function" message.

RESOLUTION

Wrap the entire reference as a text string inside an Eval() function. This tells Microsoft Access to consider the entire reference as a whole and not to attempt to parse it.

For example, to refer to the first (left-most) column of a combo box in the Criteria row of the QBE grid, use the following syntax.

   Eval("[Forms]![FormName]![ComboBoxName].[Column](0)")


Additional query words: QBF column property Eval
Keywords : kberrmsg kbusage
Version : 2.0 7.0 97
Platform : WINDOWS
Hardware : x86
Issue type : kbprb
Solution 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: November 25, 1997
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.