Solved

Search combo error "Data Type Mismatch in Criteria Expression"

Posted on 2016-11-07
2
80 Views
Last Modified: 2016-11-07
I have a combo to search for records with filter on. I am getting the below erro
Search combo error "Data Type Mismatch in Criteria Expression"
Below is the code used
If IsNull(customer_search_combo) Then
Me.FilterOn = False
Else
'Me.Filter = "cust_nameCB = '" & Me.customer_search_combo & "'"
Me.Filter = "customer_name = " & Me.customer_search_combo
Me.FilterOn = True
End If

Can someone help
0
Comment
Question by:-MAS
2 Comments
 
LVL 51

Accepted Solution

by:
Ryan Chong earned 500 total points
ID: 41878221
try change:
Me.Filter = "cust_nameCB = '" & Me.customer_search_combo & "'"

Open in new window

to:
Me.Filter = "cust_nameCB = " & Me.customer_search_combo

Open in new window

instead?
0
 
LVL 25

Author Closing Comment

by:-MAS
ID: 41878223
Thanks a lot. It worked
0

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article describes two methods for creating a combo box that can be used to add new items to the row source -- one for simple lookup tables, and one for a more complex row source where the new item needs data for several fields.
AutoNumbers should increment automatically, without duplicates.  But sometimes something goes wrong, and the next AutoNumber value is a duplicate.  This article shows how to recover from this problem.
Learn how to number pages in an Access report over each group. Activate two pass printing by referencing the pages property: Add code to the Page Footers OnFormat event to capture the pages as there occur for each group. Use the pages property to …
Using Microsoft Access, learn some simple rules for how to construct tables in a relational database. Split up all multi-value fields into single values: Split up fields that belong to other things into separate tables: Make sure that all record…

713 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question