link in subform for 2 fields

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
 
K

Klatuu

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.
 
R

ronytimm

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]
 
K

Klatuu

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.
 
R

ronytimm

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top