Hey guys, I'm having a problem getting my code to recognize EOF.
I get a "no current record" error message when it hits the bold line below. When I debug I find that the error message is correct b/c iSortKey = 1, and the last record in that field for rsMatch is 1 so the next would be the EOF. But, the code shouldn't even get that far b/c rsMatch.EOF = True. For some reason its not getting out of the loop. Do I have something wrong?
Code:
iCount = 1
rsMatch.MoveFirst
iSortKey = rsMatch![SortKey]
iRevKey = rsRev![SORT KEY]
While Not rsMatch.EOF
If iCount <> 1 Then
rsMatch.MoveNext
iSortKey = rsMatch![SortKey]
End If
Do Until iSortKey = iRevKey
If rsRev.EOF Then
rsRev.MoveFirst
End If
rsRev.MoveNext
iRevKey = rsRev![SORT KEY]
Loop
If rsRev![BREAKPT] <> rsMatch![breakpoint] Then
rsRev.MoveFirst
While Not rsRev.EOF
iCurrentKey = rsRev![SORT KEY]
rsRev.Edit
If rsRev![SORT KEY] >= iRevKey Then
rsRev![SORT KEY] = iCurrentKey + 1
End If
rsRev.Update
rsRev.MoveNext
Wend
End If
iCount = iCount + 1
Wend