How to filter a combobox with Like "[textboxvalue]_?"?

FISHiEE

Fish obsessive
Local time
Today, 17:30
Joined
Nov 12, 2004
Messages
86
Hi,

I have a combobox on a subform, the source of which is a table. I would like to filter those source records based on the value of a field in the parent form but can't work out the syntax for the code!

The scenario is that I have various products (doors) which can have any number of extras. I want to filter the extras so that only extras for those products can be shown. Most extras are numbered simple as Sec001, Sec002, Fir001, Fir002 etc. for the security doors or fire doors, so can filter those easily by using like "Sec*".

However I also can have extras created specifically for that door only (eg a special lock only ever to be used for that door). These extras are then given a number which is the door part number plus a suffix _A, _B etc.

I would like to only see those extras in the combobox when in the relevant door record. The door part number is shown in the textbox [Door_Part_Number] so would like to add to the conditions in the combobox source query a condition similar to Like [Door_Part_Number] & "_?" but cannot work out the correct syntax for this condition.

If anyone could help I'd be eternally grateful!

Thanks in advance

John
 
You should base your combo on a query, not the table. Use the value from the main form as a criterion in the query.

As an alternative, you might like to look at a cascading combo model where the results of one combo filter the results of the next. Search on 'cascading combo'.
 

Users who are viewing this thread

Back
Top Bottom