J
jdberman
I am having an issue with how to refer to a control on a subform from
within the subform itself in a SQL query. I know how to do this
ordinarily, but the case I am dealing with is a little more
complicated. Originally, I had a form [Customer List]. [Customer
List] had two subforms, [Customer Ship To List] and [Customer Product
List]. The two controls of interest on [Customer Product List] are
called ProductName and ProductCode. ProductCode is a Combo Box that
filters by ProductName. Since it is on a subform of [Customer List],
in the query for the combo box, I had to refer to ProductName as Forms!
[Customer List].Form![Customer Product List].Form!ProductName.
None of this created any problems until I had to make [Customer List]
a subform of another for [Customer Parent]. Now I need to have the
query refer to Forms![Customer Parent].Form![Customer List].Form!
[Customer Product List].Form!ProductName for it to work when [Customer
Parent] is open. But of course it will not work when just [Customer
List] is open. Is there a way to refer to an item on the subform
without referring directly to the entire tree of parents?
Thanks for any help that can be offered.
within the subform itself in a SQL query. I know how to do this
ordinarily, but the case I am dealing with is a little more
complicated. Originally, I had a form [Customer List]. [Customer
List] had two subforms, [Customer Ship To List] and [Customer Product
List]. The two controls of interest on [Customer Product List] are
called ProductName and ProductCode. ProductCode is a Combo Box that
filters by ProductName. Since it is on a subform of [Customer List],
in the query for the combo box, I had to refer to ProductName as Forms!
[Customer List].Form![Customer Product List].Form!ProductName.
None of this created any problems until I had to make [Customer List]
a subform of another for [Customer Parent]. Now I need to have the
query refer to Forms![Customer Parent].Form![Customer List].Form!
[Customer Product List].Form!ProductName for it to work when [Customer
Parent] is open. But of course it will not work when just [Customer
List] is open. Is there a way to refer to an item on the subform
without referring directly to the entire tree of parents?
Thanks for any help that can be offered.