Microsoft KB Archive/101673

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

Article ID: 101673

Article Last Modified on 1/18/2007

-

APPLIES TO


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

-



This article was previously published under Q101673



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



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

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



STATUS
Microsoft has confirmed this to be a problem in the versions of Microsoft Access listed at the beginning of this article.



Steps to Reproduce Problem
 Open the sample database Northwind.mdb (or NWIND.MDB in version 2.0 or earlier), and create a new form based on the Orders table.  Add a combo box control with the following properties:

     Form: PromptForm RecordSource: Orders

Combo box: Name: TheCombo RowSource: Orders 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 ([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 </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">