This article was previously published under Q287709
Novice: Requires knowledge of the user interface on single-user computers.
This article applies only to a Microsoft Access database (.mdb).
For a Microsoft Access 2000 version of this article, see 202269.
When you use a combo box or a list box to perform a Filter By Form, you may receive one of the following error messages:
Type mismatch in expression.
Type mismatch in JOIN expression
Microsoft Access didn't apply the filter.
Microsoft Access may not be able to apply the filter if you entered an invalid data type in one of the fields. Do you want to close the filter anyway?
If you click Yes, Microsoft Access will build the filter, but won't apply it to the recordset. Then it will close the Filter By Form window.
The control is bound to a field with a different data type than the bound column in the row source of the Lookup field. If the combo box or list box has a value assigned to its ControlSource property, it should be of the same data type as the fields populating the list.
Change the data type of either the control source or the bound column of the Lookup field to match the correct fields.
Microsoft has confirmed that this is a problem in the Microsoft products that are listed at the beginning of this article.
Steps to Reproduce the Behavior
In a new database, create a new table with the following property assignments, and name it Table1:
Table: Table1 ----------------- Field Name: Id Data Type: Number Field Name: Name Data Type: Text
Open the Table1 table in Datasheet view, and when you are prompted to save it, click Yes. When you are prompted for a primary key, click No.
Add the following records to the Table1 table:
Id Name ----------------- 10001 Apples 10002 Pears 10003 Oranges
Create another table with the following property assignments, and name it Table2:
Table: Table2 ---------------- Field Name: Test Data Type: Text
On the Lookup tab, set the following properties for the Test field:
Close and save the Table2 table. When you are prompted to create a primary key, click No.
Use the Form Wizard to create a new form that is based on the Table2 table, add the Test field, and then click Finish.
In Form view of the new form, point to Filter on the Records menu, and then click Filter By Form.
Select one of the names from the Test combo box.
On the Filter menu, click Apply Filter/Sort.
Note that you receive one of the the error messages that is mentioned in the "Symptoms" section of this article. In this case, switching to Design view in the Table2 table and changing the Test field data type to Number resolves the issue.
For more information about Filter By Form, click Microsoft Access Help on the Help menu, type about filters in the Office Assistant or the Answer Wizard, and then click Search to view the "About Filters" topic.
For more information about Lookup fields, click Microsoft Access Help on the Help menu, type lookup fields in the Office Assistant or the Answer Wizard, and then click Search to view the topics returned.
drop dropdown filtered filtering pra problems OfficeErrorMessages 10026