link in subform for 2 fields

  • Thread starter Thread starter ronytimm
  • Start date Start date
R

ronytimm

OK, I have a form and in that form a subform. Linked with child and master
ID. Works all well. In the subform, I have two combo boxes to select data.
For instance combo box 1 is category and combo box 2 is product. How can I
link both, whereas if category A is selected in como box 1 the combo box 2
only shows products of category A as in my table equipment.
thnx for your kind help
 
This is a common technique called Cascading combos. The way to do it is to
filter the row source query of the Products combo on the value of the
Category filter.
Then in the After Update event of the Category combo, Requery the Product
combo.
 
Dave,

that is what I did, but considering the subform is not open on clicking the
combo box product I get a pop up requesting the reference of the Category,
this is what i used as a filter in the row source of the product
e.g. [Forms]![Frm_OfferteBeheer_Subform]![Detail_Category]
 
You said the combos are in the subform, so there should be no problem. It
may be the reference [Forms]![Frm_OfferteBeheer_Subform]![Detail_Category]
It doesn't look right. First, Frm_OfferteBeheer_Subform should be the name
of the control on the form, not the name of the form being used as the
subform. Also, you need to reference the Form property of the subform
control. It should be:
Forms!MainFormName!SubFormControlName.Form!ControlName
--
Dave Hargis, Microsoft Access MVP


ronytimm said:
Dave,

that is what I did, but considering the subform is not open on clicking the
combo box product I get a pop up requesting the reference of the Category,
this is what i used as a filter in the row source of the product
e.g. [Forms]![Frm_OfferteBeheer_Subform]![Detail_Category]

Klatuu said:
This is a common technique called Cascading combos. The way to do it is to
filter the row source query of the Products combo on the value of the
Category filter.
Then in the After Update event of the Category combo, Requery the Product
combo.
 
success! thnx dave. was so simple. Grtz

Klatuu said:
You said the combos are in the subform, so there should be no problem. It
may be the reference [Forms]![Frm_OfferteBeheer_Subform]![Detail_Category]
It doesn't look right. First, Frm_OfferteBeheer_Subform should be the name
of the control on the form, not the name of the form being used as the
subform. Also, you need to reference the Form property of the subform
control. It should be:
Forms!MainFormName!SubFormControlName.Form!ControlName
--
Dave Hargis, Microsoft Access MVP


ronytimm said:
Dave,

that is what I did, but considering the subform is not open on clicking the
combo box product I get a pop up requesting the reference of the Category,
this is what i used as a filter in the row source of the product
e.g. [Forms]![Frm_OfferteBeheer_Subform]![Detail_Category]

Klatuu said:
This is a common technique called Cascading combos. The way to do it is to
filter the row source query of the Products combo on the value of the
Category filter.
Then in the After Update event of the Category combo, Requery the Product
combo.
--
Dave Hargis, Microsoft Access MVP


:

OK, I have a form and in that form a subform. Linked with child and master
ID. Works all well. In the subform, I have two combo boxes to select data.
For instance combo box 1 is category and combo box 2 is product. How can I
link both, whereas if category A is selected in como box 1 the combo box 2
only shows products of category A as in my table equipment.
thnx for your kind help
 
Back
Top