Option Group in Form

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have an option group with 4 option buttons (Wood, HPL, Melamine, Other) on
a form called TBLCabinetry. The user will have to select one of these
choices before they go to a field called "MaterialID". This is a combo box
where the Row Source Type is set to Table/Query. The 3 columns in the query
are "MaterialID", "DescriptionField", and "MaterialType". The Material Type
field is a combo box value list, from a table called TBLMaterials, with 4
values (Wood, HPL, Melamine, Other).

How can I make it so that when the user selects the option button they want
to have the MaterialID combo box be filtered to only show the values that
match the option button they selected. So for example if someone selected
the HPL option button and then went to the MaterialID field the only material
types that would be available to choose from would be HPL material types.

Thank you for your help.
 
Matt,
I'd use a Listbox (ex. lstMaterialType) instead of a an Option Group. It
acts just like an OptionGroup, but value it produces is directly comparable
to the values in your ComboBox. The Combobox (ex. cboYourCombo) could be
filtered by the value in the Listbox, "directly".
If you use an OptionGroup, you'll have to convert the output number
values (1 thru 4) to text values in order to compare them to the values in
your cboYourCombo.

In the query behind cboYourCombo, in the MaterialType column, use this
criteria... (use your own names)
=Forms!frmYourFormName!lstMaterialType

On the AfterUpdate event of lstMaterialType...
Your2ndCombo.requery

Now, the combo will always be filtered by the contents of the Listbox.
hth
Al Camp
 
Back
Top