I have a from with 2 levels of subforms.
Main_Form: Order Level
Sub_Form Level 1: Batch Level (many batches: 1 order)
Sub_Form Level 2: Part Level (many parts: 1 batch)
I have an append query to add a part to a batch:
PARAMETERS [Forms]![Dashboard]![Order_Number] Long;
INSERT INTO Cleaning_Batch_Sub_Parts ( fkBatchID, Sequence )
SELECT [Forms]![Dashboard_sub]![pkOrderBatchID] AS Expr4, [Cleaning_Batch_Sub_Parts]![Sequence]+1 AS Expr1
FROM Device_Cleaning_OrderHead INNER JOIN (Cleaning_Batch_Parameters INNER JOIN Cleaning_Batch_Sub_Parts ON Cleaning_Batch_Parameters.pkOrderBatchID = Cleaning_Batch_Sub_Parts.fkBatchID) ON Device_Cleaning_OrderHead.Order_ID = Cleaning_Batch_Parameters.fkOrderID
WHERE ((([Cleaning_Batch_Sub_Parts]![fkBatchID])=[Cleaning_Batch_Parameters]![pkOrderBatchID]));
Where I get hung up at is the [Forms]![Dashboard_sub]![pkOrderBatchID] AS Expr4
The value pkOrderBatchID is on the subform level 1 and is necessary info for subform level 2 so it knows which batch to put the part into. Whenever i run the query, this value pops-up as a parameter entry and does not automaticaly see which value the subform is on. How do I get this to automatically reference the sub-form level 1 value in the query??
Thanks