gerard1979
MIS
I have a simple duplicate procedure
The Idea is: first copy all values of a form to a TempTable
Then change the name of the product
Then put the values into the product table
Drop the temptable
Problem: there are true/false field (2meter,4meter,afwijk_baan, tegel, afwijk_tegel)
how to copy these values back into the table?
See the procedure below,
thanx in advance
gerard
strSQL = "SELECT STALEN_tblProduct.pr_beschrijving, STALEN_tblProduct.aantal_stalen, " & _
"STALEN_tblProduct.CP_ID, STALEN_tblProduct.MP_Id, STALEN_tblProduct.pr_code, " & _
"STALEN_tblProduct.[2meter], STALEN_tblProduct.[4meter], STALEN_tblProduct.tegel, " & _
"STALEN_tblProduct.afwijk_baan, STALEN_tblProduct.afwijk_tegel, STALEN_tblProduct.bijzonderheid" & _
" INTO STALEN_DuplicateStaal FROM STALEN_tblProduct WHERE product_id = " & TempProductID
DoCmd.RunSQL strSQL
strSQL = "UPDATE STALEN_DuplicateStaal " & _
"SET pr_beschrijving = '" & InputBox("Geef naam staal", "Dupliceer staal"
& "'"
DoCmd.RunSQL strSQL
strSQL = "INSERT INTO STALEN_tblProduct SELECT * FROM STALEN_DuplicateStaal"
DoCmd.RunSQL strSQL
strSQL = "DROP Table STALEN_DuplicateStaal"
DoCmd.RunSQL strSQL
The Idea is: first copy all values of a form to a TempTable
Then change the name of the product
Then put the values into the product table
Drop the temptable
Problem: there are true/false field (2meter,4meter,afwijk_baan, tegel, afwijk_tegel)
how to copy these values back into the table?
See the procedure below,
thanx in advance
gerard
strSQL = "SELECT STALEN_tblProduct.pr_beschrijving, STALEN_tblProduct.aantal_stalen, " & _
"STALEN_tblProduct.CP_ID, STALEN_tblProduct.MP_Id, STALEN_tblProduct.pr_code, " & _
"STALEN_tblProduct.[2meter], STALEN_tblProduct.[4meter], STALEN_tblProduct.tegel, " & _
"STALEN_tblProduct.afwijk_baan, STALEN_tblProduct.afwijk_tegel, STALEN_tblProduct.bijzonderheid" & _
" INTO STALEN_DuplicateStaal FROM STALEN_tblProduct WHERE product_id = " & TempProductID
DoCmd.RunSQL strSQL
strSQL = "UPDATE STALEN_DuplicateStaal " & _
"SET pr_beschrijving = '" & InputBox("Geef naam staal", "Dupliceer staal"
DoCmd.RunSQL strSQL
strSQL = "INSERT INTO STALEN_tblProduct SELECT * FROM STALEN_DuplicateStaal"
DoCmd.RunSQL strSQL
strSQL = "DROP Table STALEN_DuplicateStaal"
DoCmd.RunSQL strSQL