The following While Loop is producing an error in the nested While Loop when it reaches EOF. Can anyone help me determine why? The error is Run-Time Error 3021: Either BOF or EOF is True, or the current record has been deleted. Requested operation requires a current record.
While Not SummaryRS.EOF And Not CancelPrintout
I = I + 2
CFtemp = ""
If IsNull(SummaryRS!CountyFiled) Then
.Cells(I, 2) = "NULL"
CFtemp = SummaryRS!CountyFiled
.Cells(I, 2) = SummaryRS!CountyFiled
CFcount = 0
While CFtemp = SummaryRS!CountyFiled _
Or IsNull(SummaryRS!CountyFiled) _
And Not SummaryRS.EOF
CFcount = CFcount + 1
.Cells(I, 4) = CFcount