Filter by form with textbox or combo box

GS500

Registered User.
Local time
Today, 09:01
Joined
Nov 20, 2012
Messages
40
I am trying to apply the following filter to my form:

Code:
Me.Filter = "[ClaimNum] = '*" & Me.txtSearchClaim & "*'" OR "[ReviewerName] =" & Me.cboSearchReviewer.Column(1)
but I'm getting a type mismatch error.

I'm using the .Column(1) property to return the text value of the combo box rather than the ID, basically because the ID value didn't work either.

Can anyone give me the proper syntax for the above statement, or can I even link the two filter statements together using OR?

Thanks

Edit: I just realized that since [ReviewerName] actually stores the FK from the Reviewer table I would need to filter by the ID column in t he combobox.
 
Last edited:
Sure, but you've closed off the string before OR. Take out the quotes on both sides of it.
 
That worked, thanks!
 
Reviving this thread because I've noticed the above solution doesn't work if the combobox is Null. How can I handle that? The filter I currently have is below:

Code:
Me.Filter = "[ClaimNum] = '*" & Me.txtSearchClaim & "*' Or [ReviewerName] = " & Me.cboSearchReviewer

Thanks
 
I would only add the second filter if something was selected.
 

Users who are viewing this thread

Back
Top Bottom