Dear all good evening!
I have created an insert query in Ms Access for the purpose of updating the temporal table with equal fields. The data is supposed to be updated from tblProduct to tblProductTemple, the update here is supposed to only write new addition only not over writing the existing data.
If you check the two tables you will find that tblproducttemp is missing two records compared to tblproduct, now the goal here is to update only the missing record with the open event start up form NO duplicate must never be allowed, only clean record.
VBA Code
Actual insert query require fine tuning not to allow duplicates
I have created an insert query in Ms Access for the purpose of updating the temporal table with equal fields. The data is supposed to be updated from tblProduct to tblProductTemple, the update here is supposed to only write new addition only not over writing the existing data.
If you check the two tables you will find that tblproducttemp is missing two records compared to tblproduct, now the goal here is to update only the missing record with the open event start up form NO duplicate must never be allowed, only clean record.
VBA Code
Code:
Private Sub Form_Open(Cancel As Integer)
DoCmd.SetWarnings False
DoCmd.OpenQuery "QryStockUpdates"
End Sub
Actual insert query require fine tuning not to allow duplicates
Code:
INSERT INTO tblProductsTemp ( ProductID, ProductName, Type )
SELECT tblProducts.ProductID, tblProducts.ProductName, tblProducts.Type
FROM tblProducts;