I am new to using Access and was wondering whether anyone can help me with VBA code which copies data from one table to another.
I have 3 tables:
- Order
- Order_Line
- Import_Order_Lines
I have got a macro working which imports records from CSV into the Import_Order_Lines table. The problem with this data is that the OrderDate and all customer delivery address details are repeated for each order line, therefore I want to split the data up into Order and OrderLine tables.
Each record in the Import_Order_Lines needs the following data copied into the Order_Line table:
- OrderNo
- ProductID
- Qty
- Price
The following data needs to be copied from Import_Order_Lines to Order
- OrderNo
- OrderDate
- CustomerName
- CustomerDeliveryAddress
- CustomerSuburb
- CustomerState
- CustomerPostCode
How can this be done in VB using SQL?
I have 3 tables:
- Order
- Order_Line
- Import_Order_Lines
I have got a macro working which imports records from CSV into the Import_Order_Lines table. The problem with this data is that the OrderDate and all customer delivery address details are repeated for each order line, therefore I want to split the data up into Order and OrderLine tables.
Each record in the Import_Order_Lines needs the following data copied into the Order_Line table:
- OrderNo
- ProductID
- Qty
- Price
The following data needs to be copied from Import_Order_Lines to Order
- OrderNo
- OrderDate
- CustomerName
- CustomerDeliveryAddress
- CustomerSuburb
- CustomerState
- CustomerPostCode
How can this be done in VB using SQL?