Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Search combo error "Data Type Mismatch in Criteria Expression"

Posted on 2016-11-07
2
Medium Priority
?
160 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 54

Accepted Solution

by:
Ryan Chong earned 2000 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 27

Author Closing Comment

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

Featured Post

[Webinar] Cloud and Mobile-First Strategy

Maybe you’ve fully adopted the cloud since the beginning. Or maybe you started with on-prem resources but are pursuing a “cloud and mobile first” strategy. Getting to that end state has its challenges. Discover how to build out a 100% cloud and mobile IT strategy in this webinar.

Question has a verified solution.

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

Code that checks the QuickBooks schema table for non-updateable fields and then disables those controls on a form so users don't try to update them.
In a use case, a user needs to close an opened report by simply pressing the Escape (Esc) key. This can be done by adding macro code in Report_KeyPress or Report_KeyDown event.
In this video, Percona Solutions Engineer Barrett Chambers discusses some of the basic syntax differences between MySQL and MongoDB. To learn more check out our webinar on MongoDB administration for MySQL DBA: https://www.percona.com/resources/we…
Look below the covers at a subform control , and the form that is inside it. Explore properties and see how easy it is to aggregate, get statistics, and synchronize results for your data. A Microsoft Access subform is used to show relevant calcul…

879 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