Subform dependent combo box

F

Fox

Hi
I was wondering if anyone could help me with a combo box on a sub form

I have a form products that has a subform SuppliesUsed on the supplies used
subform I have a dependent combo box that looks up a value based on another
field.
The following rowsource works perfectly if I open the subform without the
main products form but not when the products main form is opened.

SELECT UnitPriceqry.[Unit Price]
FROM UnitPriceqry
WHERE (((UnitPriceqry.Supply)=[Forms]![SuppliesUsed]![SupplyCombo]));

how do I write the sql so that it knows that the form suppliesUsed is a
subform of the form Products?

Thanks,
 
D

Douglas J. Steele

Forms!Products!subformcontrolname.Form!SupplyCombo

Note that I put "subformcontrolname" in there. Depending on how you added
the SuppliesUsed form as a subform on the Products form, the name of the
subform control on the Products form may be something different than
SuppliesUsed. I'd try using Forms!Products!SuppliesUsed.Form!SupplyCombo
first, and if that doesn't work, you'll have to determine the name of the
subform control and use that.
 
A

Arvin Meyer [MVP]

From a main form, you refer to a subform like:

Forms!MainFormName!SubformControlName.Form!SupplyCombo

where SupplyCombo is the name of your combo box.
 
F

Fox

Thanks for your help!
--
Foxy


Arvin Meyer said:
From a main form, you refer to a subform like:

Forms!MainFormName!SubformControlName.Form!SupplyCombo

where SupplyCombo is the name of your combo box.
--
Arvin Meyer, MCP, MVP
http://www.datastrat.com
http://www.mvps.org/access
http://www.accessmvp.com


Fox said:
Hi
I was wondering if anyone could help me with a combo box on a sub form

I have a form products that has a subform SuppliesUsed on the supplies
used
subform I have a dependent combo box that looks up a value based on
another
field.
The following rowsource works perfectly if I open the subform without the
main products form but not when the products main form is opened.

SELECT UnitPriceqry.[Unit Price]
FROM UnitPriceqry
WHERE (((UnitPriceqry.Supply)=[Forms]![SuppliesUsed]![SupplyCombo]));

how do I write the sql so that it knows that the form suppliesUsed is a
subform of the form Products?

Thanks,
 
F

Fox

Hey thanks for taking the time to help me on what must seem easy. I sure
apprieciate it!
--
Foxy


Douglas J. Steele said:
Forms!Products!subformcontrolname.Form!SupplyCombo

Note that I put "subformcontrolname" in there. Depending on how you added
the SuppliesUsed form as a subform on the Products form, the name of the
subform control on the Products form may be something different than
SuppliesUsed. I'd try using Forms!Products!SuppliesUsed.Form!SupplyCombo
first, and if that doesn't work, you'll have to determine the name of the
subform control and use that.

--
Doug Steele, Microsoft Access MVP

(no e-mails, please!)


Fox said:
Hi
I was wondering if anyone could help me with a combo box on a sub form

I have a form products that has a subform SuppliesUsed on the supplies
used
subform I have a dependent combo box that looks up a value based on
another
field.
The following rowsource works perfectly if I open the subform without the
main products form but not when the products main form is opened.

SELECT UnitPriceqry.[Unit Price]
FROM UnitPriceqry
WHERE (((UnitPriceqry.Supply)=[Forms]![SuppliesUsed]![SupplyCombo]));

how do I write the sql so that it knows that the form suppliesUsed is a
subform of the form Products?

Thanks,
 

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