Microsoft KB Archive/209496

= ACC2000: "Undefined Function" Error Message Referencing Column Property =

Article ID: 209496

Article Last Modified on 12/12/2002

-

APPLIES TO


 * Microsoft Access 2000 Standard Edition

-



This article was previously published under Q209496



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

This article applies only to a Microsoft Access database (.mdb).



SYMPTOMS
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, Access will consider the entire reference as a whole, and will not try parsing it. For example:

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



STATUS
Microsoft has confirmed that this is a problem in the Microsoft products that are listed at the beginning of this article.



MORE INFORMATION
CAUTION: If you follow the steps in this example, you modify the sample database Northwind.mdb. You may want to back up the Northwind.mdb file and follow these steps on a copy of the database.

Steps to Reproduce Problem
 Open the sample database Northwind.mdb and create a new form based on the Orders table.  Add a combo box control with the following properties:   Form: PromptForm -  ControlSource: Orders

Combo box --  Name: TheCombo ControlSource: Selection Field ColumnCount: 4 BoundColumn: 1  Save the form as PromptForm, and then close it.  Create the following query based on the Employees table: <pre class="fixed_text">  Query: ReferenceCombo ---  Type: Select Query

Field: EmployeeID Table: Employees Criteria: =[Forms]![PromptForm]![TheCombo].column(2)

Field: LastName Table: Employees

Field: FirstName Table: Employees </li> Open the PromptForm form in Form view, and select an item from the combo box.</li> Open the ReferenceCombo query in Datasheet view. Note that you receive the following error message:

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

</li></ol>

<div class="references_section">