stephantmi54 i think i saw it
With Rec3
For i = 0 To Rec.RecordCount - 1
.AddNew
Rec3.Fields("ID") = Rec.Fields("ID")
Rec3.Fields("Amount") = Rec!Amount
Rec3!Remaining = Rec!Amount - Rec!Invoiced
Rec3.Fields("Vendor") = Rec!Vendor
Rec3!Description = Rec!Description
Rec3!ID = Rec!ID
Rec3!Original = 1
Rec.MoveNext
Next i
.Update
End With
The problem for start is that Rec recordset is empty to begin....you have criteria which you don't supply values so it bombs out
Also .Update should be inside the loop not outside...at least to my knowledge (never used it otherwise)
Adding a simple if .Recordcount>0 then would resolve it
With Rec3
If .RecordCount>0 then
For i = 0 To Rec.RecordCount - 1
.AddNew
Rec3.Fields("ID") = Rec.Fields("ID")
Rec3.Fields("Amount") = Rec!Amount
Rec3!Remaining = Rec!Amount - Rec!Invoiced
Rec3.Fields("Vendor") = Rec!Vendor
Rec3!Description = Rec!Description
Rec3!ID = Rec!ID
Rec3!Original = 1
Rec.MoveNext
Next i
.Update
End if
End With
P.S. if someone can tip the admins of this Community that "Insert/Edit Code Sample" is not working would be much obliged