R
ryan.fitzpatrick3
I have a combobox called cboxPlant and another called cboxSupplier.
Now I have a form that has a several comboboxes that have selections
that filter table records in the detail. This works fine. For example
if I click plant #8103 it filters everything that plant 8103
purchased. This works great. Now I have a supplier combobox that
queries all suppliers that's associated with cboxPlant.
In row source here is the SQL for cboxSupplier.
[Forms]![frmItemVolumeSpend]![cboxPlant])
This pulls all associated suppliers for which ever plant is selected.
This works fine. But since it's linked to cboxPlant I can't select a
supplier unless a Plant is selected first. I would like it to be both
ways, if every combobox is null or blank and I just want to select a
supplier only to filter that way I want to use this code
[tblAdageVendors]![en_vend_key]
This code pulls a table that has all active suppliers for all plants.
But also if I choose the plant first, I want the supplier cbox to show
only associated suppliers per plant. So I made this SQL in the query
row source of cboxSupplier.
IIf([Forms]![frmItemVolumeSpend]![cboxPlant]=Null,[tblAdageVendors]!
[en_vend_key],[Forms]![frmItemVolumeSpend]![cboxPlant])
This doesn't work, but does what I want make sense? Can it be done?
What should I do?
Also to take this one step farther I have another combobox that has
years in it, like 2000,2001,2002, etc to 2008. I would like to filter
the suppliers out more if you select plant 8103 and year 2007 the only
suppliers shown now would be the suppliers for that plant and used
only in 2007. Is this possible? year combobox is cboxYear.
Ryan
Now I have a form that has a several comboboxes that have selections
that filter table records in the detail. This works fine. For example
if I click plant #8103 it filters everything that plant 8103
purchased. This works great. Now I have a supplier combobox that
queries all suppliers that's associated with cboxPlant.
In row source here is the SQL for cboxSupplier.
[Forms]![frmItemVolumeSpend]![cboxPlant])
This pulls all associated suppliers for which ever plant is selected.
This works fine. But since it's linked to cboxPlant I can't select a
supplier unless a Plant is selected first. I would like it to be both
ways, if every combobox is null or blank and I just want to select a
supplier only to filter that way I want to use this code
[tblAdageVendors]![en_vend_key]
This code pulls a table that has all active suppliers for all plants.
But also if I choose the plant first, I want the supplier cbox to show
only associated suppliers per plant. So I made this SQL in the query
row source of cboxSupplier.
IIf([Forms]![frmItemVolumeSpend]![cboxPlant]=Null,[tblAdageVendors]!
[en_vend_key],[Forms]![frmItemVolumeSpend]![cboxPlant])
This doesn't work, but does what I want make sense? Can it be done?
What should I do?
Also to take this one step farther I have another combobox that has
years in it, like 2000,2001,2002, etc to 2008. I would like to filter
the suppliers out more if you select plant 8103 and year 2007 the only
suppliers shown now would be the suppliers for that plant and used
only in 2007. Is this possible? year combobox is cboxYear.
Ryan