Subform Combo filtered by Selected Parent Combo

S

stfcTerryA

Hi

I'm having a problem with form (frmGoodsIn) and subform (frmGoodsInItems)

My rowsource property for the subform combo is: (text is all 1 line)

SELECT tblPurchaseOrderItems.POrderItemsID,
tblPurchaseOrderItems.POrderID,
tblComponents.PartType,
tblPurchaseOrderItems.Quantity,
tblPurchaseOrderItems.QtyOutstanding

FROM tblComponents

INNER JOIN tblPurchaseOrderItems ON tblComponents.ComponentID =
tblPurchaseOrderItems.Component

WHERE (((tblPurchaseOrderItems.POrderID)=***Various Options***))

ORDER BY tblPurchaseOrderItems.POrderItemsID;

***Various Options***

1) [Forms]![frmGoodsIn]![PurchaseOrder]
2) [Me].[Parent]![PurchaseOrder]
3) [Me]![txtPONumber] (I've tried using a unbound text box on the subform to
get the PO number of the parent form - whats annoying is the text box does
show the value of parent form but it still doesn't work)

Basically the form either 1 only every shows the components order on the
very first Purchase order as in changing the parent form combo makes no
difference or when you open the form a enter parameter pop up box happens i
enter the PO number and then it shows me just those components - i cant get
it to happen dynamically as in shows the components related to the parent
form data.

Cheers


Terry
 
S

stfcTerryA

Finally found out the problem

Needed to do a AfterUpdate event on combo box in parent form

Me!frmGoodsInItems.Form.POrderItemsID.Requery

3 Days!!! 2 days reading books trying to find answer before bitting the
bullet and posting here, well hope it helps someone else one day.

Cheers


Terry
 
S

stfcTerryA

Unfortunately it's back to the drawing board - what i've found out is by
adding the AfterUpdate() the previous form records relating to a different
Purchase order has disappeared.

stfcTerryA said:
Finally found out the problem

Needed to do a AfterUpdate event on combo box in parent form

Me!frmGoodsInItems.Form.POrderItemsID.Requery

3 Days!!! 2 days reading books trying to find answer before bitting the
bullet and posting here, well hope it helps someone else one day.

Cheers


Terry

stfcTerryA said:
Hi

I'm having a problem with form (frmGoodsIn) and subform (frmGoodsInItems)

My rowsource property for the subform combo is: (text is all 1 line)

SELECT tblPurchaseOrderItems.POrderItemsID,
tblPurchaseOrderItems.POrderID,
tblComponents.PartType,
tblPurchaseOrderItems.Quantity,
tblPurchaseOrderItems.QtyOutstanding

FROM tblComponents

INNER JOIN tblPurchaseOrderItems ON tblComponents.ComponentID =
tblPurchaseOrderItems.Component

WHERE (((tblPurchaseOrderItems.POrderID)=***Various Options***))

ORDER BY tblPurchaseOrderItems.POrderItemsID;

***Various Options***

1) [Forms]![frmGoodsIn]![PurchaseOrder]
2) [Me].[Parent]![PurchaseOrder]
3) [Me]![txtPONumber] (I've tried using a unbound text box on the subform to
get the PO number of the parent form - whats annoying is the text box does
show the value of parent form but it still doesn't work)

Basically the form either 1 only every shows the components order on the
very first Purchase order as in changing the parent form combo makes no
difference or when you open the form a enter parameter pop up box happens i
enter the PO number and then it shows me just those components - i cant get
it to happen dynamically as in shows the components related to the parent
form data.

Cheers


Terry
 

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