Hi Guys,
I'm trying to copy a record to a new record and copy ALL data from that record. What I've found so far is the Insert Into, append query solution, but I thought there should be an easier way to do this as the record has a large number of fields.
The SQL code does not run and I can't see the error to little experience I think!
Any suggestions?
I'm trying to copy a record to a new record and copy ALL data from that record. What I've found so far is the Insert Into, append query solution, but I thought there should be an easier way to do this as the record has a large number of fields.
The SQL code does not run and I can't see the error to little experience I think!
Code:
Dim strSQL1 As String
Dim strSQL2 As String
Dim strSQL3 As String
Dim strSQL4 As String
strSQL1 = "INSERT INTO tblProducts ( ProductPartNumber, ProductShortDescription, ProductLongDescription, " & _
"ProductListPrice , ProductCurrencyID, ProductMultiplier, ProductMultiplierType, ProductMultiplierFixed, " & _
"ProductActive, ProductFunction, ProductVoltage1, ProductPower, ProductPowerUnit, ProductRange, " & _
"ProductPhoto, ProductRoom, ProductTag, ProductDesc, ProductFlowUnit, ProductMinFlow, " & _
"ProductMaxFlow, ProductModelCode, ProductDiscount, ProductDutyTax, ProductFreight, ProductStock, " & _
"ProductDeliveryTime, ProductDeliveryUnit, ProductDatasheet, ProductChangeDate, ProductComSoftTime, " & _
"ProductComTime, ProductWeight, ProductVolume ) "
strSQL2 = "Select ProductPartNumber, ProductShortDescription, ProductLongDescription, " & _
"ProductListPrice , ProductCurrencyID, ProductMultiplier, ProductMultiplierType, ProductMultiplierFixed, " & _
"ProductActive, ProductFunction, ProductVoltage1, ProductPower, ProductPowerUnit, ProductRange, " & _
"ProductPhoto, ProductRoom, ProductTag, ProductDesc, ProductFlowUnit, ProductMinFlow, " & _
"ProductMaxFlow, ProductModelCode, ProductDiscount, ProductDutyTax, ProductFreight, ProductStock, " & _
"ProductDeliveryTime, ProductDeliveryUnit, ProductDatasheet, ProductChangeDate, ProductComSoftTime, " & _
"ProductComTime, ProductWeight, ProductVolume from tblProducts "
strSQL3 = "WHERE (ProductID = " & Me.fldProductID & ");"
strSQL4 = strSQL1 & strSQL2 & strSQL3
DoCmd.RunSQL strSQL4
Last edited: