Using 2 combos to filter list

thudson

Old Programmer
Local time
Today, 23:47
Joined
Apr 29, 2011
Messages
68
I have 2 combos called Event & Sub_Event that filter a list called verses according to the input of the combos.
It works to an extent, but it works on the text in the combo and I want to filter based on it's ID.
Here is the staetment in the query:
Like "*" & [Forms]![Find Verse]![cboEvent] & "*" And Like "*" & [Forms]![Find Verse]![cboSub_Event] & "*"
There are 2 columns in the combo tables typically SID & Event.
The combo is bound to column 1.
How I found that the query was not working correctly, is because I had 2 sub_Events with the word One in them.
Any ideas how I can fix this?
 
Hi. You want to filter by ID but you're using the Like operator? What happens if you simply use the equal symbol instead?
 
if sid and event tables don't have autonumber field, add it now and include in SQL of the rowsource of your combo's:

select id, eventName from event;

then on the combos property->number of column (design view), set it to 2:
column widths: 0";1"

the combo now is bound to column 1 which is the id.

your query will changed to:

...=" & [Forms]![Find Verse]![cboEvent] & " OR [fieldNameHere] =" & [Forms]![Find Verse]![cboSub_Event]
 

Users who are viewing this thread

Back
Top Bottom