I'm filling in a Report with SQL data using VB code. I'm using LOOP and MoveNext. Before using MoveNext, I would like to be able to check whether the new data is equal to the previous data that was added. I'm not sure if MovePrevious is the best way to accomplish this. Here's an example of my code:
With rs
.MoveFirst
strData = Trim(!data)
Do While Not .EOF
If Not .BOF Then
.MovePrevious
strDataPrev = Trim(!data)
.MoveNext
End If
If (strData <> strDataPrev) Then
'The record is new
End If
.MoveNext
Loop
.Close
End With
Will this work? Or is another method better?