Hi, I got this code
What I want to achieve is to select every record in TmpPartsTableAll, look if there is duplicate record in it, then move it to a new table called TmpConcatenateParts. I know that .EOF and .MoveNext is for RecordSet, but I dont know the same attribute for table in Access. Anyone can help with the DO WHILE clause? And is that correct for the query StrConcSQL?Thanks!
n.b it is similar to my previous thread
Code:
Do While TmpPartsTableAll.EOF = False
With TmpPartsTableAll
If .TmpPartNumber = DLookup("PartNumber", "TempConcatenateParts", "PartNumber=" & .TmpPartNumber) Then
StrConcSQL = "UPDATE TmpConcatenateParts SET Qty=Qty+" & .TmpQty & ",UnitCost=UnitCost+" & .TmpPartCost _
& " WHERE PartNumber=" & .TmpPartNumber
Else
StrConcSQL = "INSERT INTO TmpConcatenateParts ([PartNumber], [PartDescription], [Material], [Qty], [UnitCost], [VendorPart], " & _
"[Vendor], [Comment]) " & _
"VALUES ( .TmpPartNumber, .TmpPartDescription, .TmpMaterial, .TmpQty, .TmpPartCost, .TmpVendorPart, .TmpVendorDesc, .TmpComments)"
End If
TmpPartsTableAll.MoveNext
Loop
What I want to achieve is to select every record in TmpPartsTableAll, look if there is duplicate record in it, then move it to a new table called TmpConcatenateParts. I know that .EOF and .MoveNext is for RecordSet, but I dont know the same attribute for table in Access. Anyone can help with the DO WHILE clause? And is that correct for the query StrConcSQL?Thanks!
n.b it is similar to my previous thread