I need to append a single record of a subform named Delivery Dockets on a form called Jobs to a temp table named Delivery Dockets Temp more than once depending on the number entered in a field named "Pieces" in the subform. I currently have a button on the main form Jobs that currently calls this append query to add the record to the temp table. But I need it to append more then once depending on the number entered into the field named Pieces.
INSERT INTO [Delivery Docket Temp] ( DeliveryDocketID, JobID, ConsignorID, ConsigneeID, DeliveryDocketNo, PurchaseOrderNo, SpecNo, Pieces, GoodsDescription, Weight, DeliveryDocketDate, CollectionDate, DeliveryDate, OrderedBy, CustomerID, DeliveryTime, DANNumber, InStockDate, Delivered, P )
SELECT [Delivery Dockets].DeliveryDocketID, [Delivery Dockets].JobID, [Delivery Dockets].ConsignorID, [Delivery Dockets].ConsigneeID, [Delivery Dockets].DeliveryDocketNo, [Delivery Dockets].PurchaseOrderNo, [Delivery Dockets].SpecNo, [Delivery Dockets].Pieces, [Delivery Dockets].GoodsDescription, [Delivery Dockets].Weight, [Delivery Dockets].DeliveryDocketDate, [Delivery Dockets].CollectionDate, [Delivery Dockets].DeliveryDate, [Delivery Dockets].OrderedBy, [Delivery Dockets].CustomerID, [Delivery Dockets].DeliveryTime, [Delivery Dockets].DANNumber, [Delivery Dockets].InStockDate, [Delivery Dockets].Delivered, [Delivery Dockets].P
FROM Jobs INNER JOIN [Delivery Dockets] ON Jobs.JobID = [Delivery Dockets].JobID
WHERE ((([Delivery Dockets].JobID)=[Forms]![Jobs]![JobID]) AND (([Delivery Dockets].P)=Yes));
Any ideas would be greatly appreciated.
INSERT INTO [Delivery Docket Temp] ( DeliveryDocketID, JobID, ConsignorID, ConsigneeID, DeliveryDocketNo, PurchaseOrderNo, SpecNo, Pieces, GoodsDescription, Weight, DeliveryDocketDate, CollectionDate, DeliveryDate, OrderedBy, CustomerID, DeliveryTime, DANNumber, InStockDate, Delivered, P )
SELECT [Delivery Dockets].DeliveryDocketID, [Delivery Dockets].JobID, [Delivery Dockets].ConsignorID, [Delivery Dockets].ConsigneeID, [Delivery Dockets].DeliveryDocketNo, [Delivery Dockets].PurchaseOrderNo, [Delivery Dockets].SpecNo, [Delivery Dockets].Pieces, [Delivery Dockets].GoodsDescription, [Delivery Dockets].Weight, [Delivery Dockets].DeliveryDocketDate, [Delivery Dockets].CollectionDate, [Delivery Dockets].DeliveryDate, [Delivery Dockets].OrderedBy, [Delivery Dockets].CustomerID, [Delivery Dockets].DeliveryTime, [Delivery Dockets].DANNumber, [Delivery Dockets].InStockDate, [Delivery Dockets].Delivered, [Delivery Dockets].P
FROM Jobs INNER JOIN [Delivery Dockets] ON Jobs.JobID = [Delivery Dockets].JobID
WHERE ((([Delivery Dockets].JobID)=[Forms]![Jobs]![JobID]) AND (([Delivery Dockets].P)=Yes));
Any ideas would be greatly appreciated.