I'm trying to iterate through a recordset object by using the methods movefirst, movelast, and movenext. The objective is to test to see if a column in the recordset contains the same value as a user input (dSD) a row at a time. I've got a counter that keeps track of any matches, so that if variable iDuplicate is not 0 then I know there has been at least one match. If it iterates through the entire recordset without any matches, iDuplicate will be 0.
iDuplicate = 0
Do While Not objRST.EOF
If dSD = objRST("sd") Then
iDuplicate = iDuplicate + 1
The problem is, I keep getting this error:
"3021,ADODB.Field,Either BOF or EOF is True, or the current record has been deleted. Requested operation requires a current record."
I used to write DAO in similar fashion without problems. Obviously there is a problem somewhere in the above snippet of code, but I can not see where it's at. Can anyone pick it up?