want to populate Purchase order subform with items from workorder

C

Cathy Michels

This is my first time posting a question but I would like to say 'thanks' for
all of the many solutions I have found over the last several months from this
amazing site.

I have been designing a database that has a form to enter Workorders
(frmWorkorders) for customer equipment repairs. This form contains a subform
(fsubWorkOrderParts) that is a continuous form that lists the parts that will
be used to make the repairs. I have combo boxes on the subform that pull the
parts information from a linked inventory table. When a part is entered on
the subform it shows how many are in inventory. In the Workorder form footer
I have a button that opens another form (frmPurchaseOrder) to create a
Purchase Order which contains a subform (fsubPurchaseOrderParts) that is a
continuous form where parts to be ordered can be entered. I have entered
code in the Event Procedure for the command click that opens the Purchase
Order to populate the Purchase Order fields with matching information from
the Work Order. This all works great. I would also like to populate the
fsubPurchaseOrderParts with the information from the fsubWorkOrderParts so
that the parts records don't have to be reentered on the Purchase Order.
(Purchase Order parts are stored in a separate table from Work Order Parts
since not all items for a Work Order would have to be ordered - some may
already be in inventory.) But I want the Purchase Order to prefill with all
of the items from the Work Order with the option to delete items or edit
their quantities on the Purchase Order without affecting the items on the
Work Order.

I added the following lines to my code for the event procedure but only the
first record from the fsubWorkOrderParts continuous form is updated to the
fsubPurchaseOrderParts. Is there a way to get the remaining records to
populate the form?

Forms!frmPurchaseOrder!fsubPurchaseOrderParts.Form!ItemNo =
Forms!frmWorkorders!fsubWorkOrderParts.Form!ItemNo
Forms!frmPurchaseOrder!fsubPurchaseOrderParts.Form!itemcode =
Forms!frmWorkorders!fsubWorkOrderParts.Form!itemcode
Forms!frmPurchaseOrder!fsubPurchaseOrderParts.Form!Quantity =
Forms!frmWorkorders!fsubWorkOrderParts.Form!Quantity

Thanks in advance for your help. I am working in Access 2003.
 

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