Microsoft KB Archive/101673
Article ID: 101673
Article Last Modified on 1/18/2007
- 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.
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:
Microsoft Access interprets any text followed by opening and closing parentheses as a user-defined function.
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:
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:
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
- Open the PromptForm form in Form view and select an item from the combo box.
- Open the ReferenceCombo query in Datasheet view. Note that you receive the following error message: Undefined Function '[Forms]![PromptForm]![TheCombo].column' in Expression.
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: kbbug kberrmsg KB101673