Cascading Combobox in continous subform

G

Guest

Can someone please tell me how to do this.
I have a cascading combobox in a continous subform that works perfectly in
the subform but not in the main form. This is the code for the rowsource:

SELECT [tblCommodityCodes].[CommodityCodeID],
[tblCommodityCodes].[CommodityCodeDescription] FROM tblCommodityCodes WHERE
[tblCommodityCodes].[CommodityClassID]=[Forms]![sbfrmOrderDetails]![CommodityClassID] ORDER BY [tblCommodityCodes].[CommodityCodeID];

I also have the requery set like:
Private Sub CommodityCodeID_AfterUpdate()
me. Forms![FrmOrderDetailssubform]![CommodityCodeID] .Requery
End Sub

When I open the Main Form (frmOrderForm) and select an item out of the first
combobox and tab over to the second combox I get this parameter query box
that pops up "Forms!sbfrmOrderDetails!CommodityClassID"
 
A

Andi Mayer

Can someone please tell me how to do this.
I have a cascading combobox in a continous subform that works perfectly in
the subform but not in the main form. This is the code for the rowsource:

SELECT [tblCommodityCodes].[CommodityCodeID],
[tblCommodityCodes].[CommodityCodeDescription] FROM tblCommodityCodes WHERE
[tblCommodityCodes].[CommodityClassID]=[Forms]![sbfrmOrderDetails]![CommodityClassID] ORDER BY [tblCommodityCodes].[CommodityCodeID];

I also have the requery set like:
Private Sub CommodityCodeID_AfterUpdate()
me. Forms![FrmOrderDetailssubform]![CommodityCodeID] .Requery
End Sub

When I open the Main Form (frmOrderForm) and select an item out of the first
combobox and tab over to the second combox I get this parameter query box
that pops up "Forms!sbfrmOrderDetails!CommodityClassID"

is this the formname? [sbfrmOrderDetails]

it should be the control in which this form is inside
if this control has the same name then
sbfrmOrderDetails.form.CommodityClassID
 

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