Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Stmt works for cbo on subform but not parent form

Status
Not open for further replies.

KerryL

Technical User
May 7, 2001
545
US
On a customer order form I have a subform which contains the order details information, and I use a "limit-to-list" statement to narrow the choices of cbo #2 based on what is selected in cbo #1.

Table = tblProducts
CBO #1 = cboDivision
CBO #2 = cboProjDescr
SubForm = sfrmRequestDetails
Parent Form = frmCustRequests

The select statement for cboProjDescr is:
SELECT [tblProducts].[ProjectDescr] FROM tblProducts WHERE ((([tblProducts].[DivisionName])=[Forms]![sfrmRequestDetails]![cboDivision])) ORDER BY [tblProducts].[ProjectDescr];

It works fine when I test it within the subform, but when I test it by opening the parent form I am prompted to enter a value for cboDivision even though I've already selected something from the list.

Do I need to qualify my select statement differently because the subform resides in a parent form? Or is there something else I'm not considering?

Thanks in advance,
KerryL
 
Kerry:

You won't be able to directly reference the control on the subform from the parent form.

Try changing the way you reference the control on the subform from:

[Forms]![sfrmRequestDetails]![cboDivision]

to:

[Forms]![Name of Parent Form]![Name of Subform Control on Parent Form].Form![cboDivision]

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top