ACC: "Undefined Function" Err Msg Referencing Column Property

Last reviewed: May 14, 1997
Article ID: Q101673
The information in this article applies to:
  • Microsoft Access versions 1.0, 1.1, 2.0, 7.0, 97

SYMPTOMS

Novice: Requires knowledge of the user interface on single-user computers.

When you try to run macro actions that contain a "Where" clause (ApplyFilter, OpenForm, OpenReport, and FindRecord), and queries that reference the Column property of a combo box or list box on a form, you may receive the following error message:

   Undefined Function '[Forms]![Formname]![Controlname].column' in
   Expression.

CAUSE

Microsoft Access interprets any text followed by opening and closing parentheses as a user-defined function.

RESOLUTION

If you wrap the expression inside the Eval() function as a text string, Microsoft Access will consider the entire reference as a whole, and will not attempt to parse it. For example:

   Eval("[Forms]![Formname]![Controlname].column(2)")

STATUS

Microsoft has confirmed this to be a problem in Microsoft Access 1.x, 2.0, 7.0, and 97. We are researching this problem and will post new information here in the Microsoft Knowledge Base as it become available.

MORE INFORMATION

NOTE: This problem occurs only when you are attempting to reference a column other than the bound column of the combo box. If you want to reference the bound column of the combo box, just use the control name of the combo box.

Steps to Reproduce Problem

  1. Using the sample database Northwind.mdb (or NWIND.MDB in version 2.0 or earlier), create a new form based on the Orders table.

  2. Add a combo box control with the following properties:

          Form: PromptForm
          -------------------------
          RecordSource: Orders
    

          Combo box:
    
             Name: TheCombo
             RowSource: Orders
             ColumnCount: 4
             BoundColumn: 1
    
    

  3. Save the form as PromptForm and close it.

  4. Create the following query based on the Employees table:

          Query: ReferenceCombo
          ---------------------
          Type: Select Query
    

          Field: EmployeeID ([Employee ID] in Microsoft Access 1.x and 2.0)
    
             Table: Employees
             Criteria: =[Forms]![PromptForm]![TheCombo].column(2)
          Field: LastName ([Last Name] in Microsoft Access 1.x and 2.0)
             Table: Employees
          Field: FirstName ([First Name] in Microsoft Access 1.x and 2.0)
             Table: Employees
    
    

  5. Open the PromptForm form in Form view and select an item from the combo box.

  6. Open the ReferenceCombo query in Datasheet view. Note that you receive the following error message:

          Undefined Function '[Forms]![PromptForm]![TheCombo].column' in
          Expression.
    

REFERENCES

For more information about using the Column property in an expression, search on "Column property," and then "Refer to a column in a list in an expression" using the Microsoft Access 97 Help Index.


Keywords : kberrmsg kbusage QryParm
Version : 1.0 1.1 2.0 7.0 97
Platform : WINDOWS
Hardware : X86
Issue type : kbbug
Resolution Type : kbworkaround


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 14, 1997
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.