I am trying to automatically populate a nested form with records each time the parent form has a new record.
The nested forms record source is TblPrintColour.
The only way that I have been able to do this up till now is to create a duplicate table (TblPrintColour2) and use an update query to create the records in this table. The records then have to be appended to TblPrintColour with an append query and finally deleted from TblPrintColour2 with a delete query.
Is there a better way? It seems a bit overkill to be creating a table to hold temporary records.
Queries as follows.
UPDATE TblPositive LEFT JOIN TblPrintColour2 ON TblPositive.PositiveID1 = TblPrintColour2.PositiveID3 SET TblPrintColour2.Line2ID3 = Forms!FrmSOP!FrmSubOrderLine1!FrmSubOrderLine1Line2!Line2ID, TblPrintColour2.PositiveID3 = [PositiveID1], TblPrintColour2.ColourID3 = [ColourID2]
WHERE (((TblPositive.DesignID2)=[Forms]![FrmSOP]![FrmSubOrderLine1]![DesignID2]));
INSERT INTO TblPrintColour ( PositiveID3, ColourID3, Line2ID3 )
SELECT TblPrintColour2.PositiveID3, TblPrintColour2.ColourID3, TblPrintColour2.Line2ID3
FROM TblPrintColour2;
DELETE TblPrintColour2.PositiveID3, TblPrintColour2.ColourID3, TblPrintColour2.Line2ID3
FROM TblPrintColour2;
Thanks
LouiseJ
The nested forms record source is TblPrintColour.
The only way that I have been able to do this up till now is to create a duplicate table (TblPrintColour2) and use an update query to create the records in this table. The records then have to be appended to TblPrintColour with an append query and finally deleted from TblPrintColour2 with a delete query.
Is there a better way? It seems a bit overkill to be creating a table to hold temporary records.
Queries as follows.
UPDATE TblPositive LEFT JOIN TblPrintColour2 ON TblPositive.PositiveID1 = TblPrintColour2.PositiveID3 SET TblPrintColour2.Line2ID3 = Forms!FrmSOP!FrmSubOrderLine1!FrmSubOrderLine1Line2!Line2ID, TblPrintColour2.PositiveID3 = [PositiveID1], TblPrintColour2.ColourID3 = [ColourID2]
WHERE (((TblPositive.DesignID2)=[Forms]![FrmSOP]![FrmSubOrderLine1]![DesignID2]));
INSERT INTO TblPrintColour ( PositiveID3, ColourID3, Line2ID3 )
SELECT TblPrintColour2.PositiveID3, TblPrintColour2.ColourID3, TblPrintColour2.Line2ID3
FROM TblPrintColour2;
DELETE TblPrintColour2.PositiveID3, TblPrintColour2.ColourID3, TblPrintColour2.Line2ID3
FROM TblPrintColour2;
Thanks
LouiseJ