You are running the loop for number of records times.
If you want to copy all fields of one record set to another record set, you must rum the loop for number of columns times.
So try changing the loop counter.
You are right! I changed the loop to loop through the recordset fields count. However, this did not fix the problem.
The problem turned out to be: I am displaying the local database in a grid. I passed the grid recordset as an object to the sub without thinking that the fields would not be in the same order as the server database because I used the data form wizard to populate the recordset. To solve the problem, I simply passed the key fields and created a new recordset. Now the fields match and the sub works. What confused me was the error message.
Thanks very much for your help. I appreciate it very much.