I have an option group on a form that is meant to filter a report. The SQL in the RecordSource refers to a control on this form. I get the report to run fine with the radio buttons that only filter by one criterion, but I can't when I need multiple criteria. For Example, Option1 puts a number 4 in a textbox is referred to in the SQL. Option2 puts "1 AND 4 AND 8" in the textbox. My problem is that Option2 doesn't work. I'm assuming its being treated as a string when the SQL is actually looking for numbers with the AND operator between.
Part of my Select Case:
Case 1 'Option1
Me.txtOwnerFilter = 4
Me.txtClientFilter = 5
Case 6 'Option2
Me.txtOwnerFilter = "1 and 4 and 8"
Me.txtClientFilter = 5
Also, how would I go about having an Option3 that would NOT filter anything?
Case 2 'Option3
Me.txtOwnerFilter = ""
Me.txtClientFilter = 5
I tried multiple ways on this one. I tried to use --Like "*"--, which works in the query builder but not when I tried passing through the text box.
I'm not sure how to go about getting this to work. Though I have a sneaking suspicion that started out in the wrong direction in the first place.
Any help would be greatly appreciated.
Thanks!
Kevin
Part of my Select Case:
Case 1 'Option1
Me.txtOwnerFilter = 4
Me.txtClientFilter = 5
Case 6 'Option2
Me.txtOwnerFilter = "1 and 4 and 8"
Me.txtClientFilter = 5
Also, how would I go about having an Option3 that would NOT filter anything?
Case 2 'Option3
Me.txtOwnerFilter = ""
Me.txtClientFilter = 5
I tried multiple ways on this one. I tried to use --Like "*"--, which works in the query builder but not when I tried passing through the text box.
I'm not sure how to go about getting this to work. Though I have a sneaking suspicion that started out in the wrong direction in the first place.
Any help would be greatly appreciated.
Thanks!
Kevin