I want to copy all the rows from the table products having fields branch4 and items4 Not Null, into the table order details.The problem is that the table order details does not have fields branch4 and items4, instead it has fields cartons and quantity.so i have to insert branch4 into cartons and items4 into quantity.Can somebody help me ? My sql for the table products is :
SELECT products.Productid, products.branch4, products.items4 FROM products;
And for the table order details:
SELECT [order details].OrderID, [order details].cartons, [order details].Quantity FROM [order details];
I wanted to apply the following function to append:
Public Function AppendAudit()
Dim strAppendProduct As String
strAppendProduct = "INSERT INTO order details " & _
"SELECT * " & _
" FROM Products1 As o1 WHERE NOT EXISTS (SELECT * FROM Products WHERE " & _
"ProductID=o1.ProductId)"
CurrentDb.Execute strAppendProduct
End Function
However this function does not take into account the different fields to append.




