Error code:
Either BOF or EOF is True, or the current record has been deleted. Requested operation requires a current record.
In Excel 2007 and Access 2007, from Excel I deleted every RecordSet, rs. (bad move)
Code:
rs.MoveFirst
Do Until rs.EOF
rs.Delete
rs.Update
rs.MoveNext
Loop
I then am trying to reenter the new data contained in Excel but it will not let me due to the above error.
How do I write over the deleted RecordSet (#Deleted)?
Here is my code(my connection string works fine):
Code:
rs.MoveFirst
For k = 1 To Sheets("2013").Cells(Rows.Count, "A").End(xlUp).Row - 4
rs!Index = Sheets("2013").Cells(k + 4, 1).Value
rs!DatePaid = Sheets("2013").Cells(k + 4, 2).Value
rs!WhatPaid = Sheets("2013").Cells(k + 4, 3).Value
rs!AmtPaid = Sheets("2013").Cells(k + 4, 4).Value
rs!total = Sheets("2013").Cells(k + 4, 5).Value
rs!AmtRec = Sheets("2013").Cells(k + 4, 6).Value
rs!WhatRec = Sheets("2013").Cells(k + 4, 7).Value
rs!DateRec = Sheets("2013").Cells(k + 4, 8).Value
rs.Update
Next k