Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Copy and insert row with certain subrows

Status
Not open for further replies.

jeffshex

Technical User
Jun 30, 2005
208
US
I have the forms and everything built out, but am looking for a way to do copy a row from an Orders(tblOrders) table along with it's Order Details(tblOrderDetails) and insert them back in.
The only catch is that I only need to do this to any order detail record that meets certain criteria.

For example: An order is received and the user opens the invoicing form where they can review the order and enter in an unbound field the quantity of each item that was actually received. Another calculated field then updates with the "new quantity" (Expected Qty - Received Qty).
If any of the order details rows have a new quantity > 0 then I need to copy/insert the order row to a new record and then the same to the details, but only to those that have a new quantity > 0.

That way I could finalize the order with what products did come in and create a new order/order details with those items that did not come in while using the "new quantity" field for those records.

Has anyone done something like this before or can point me in the right direction?
Thanks!!!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top