I have the following Recordset code and when I step through with my first pass of the code
with the debugger, I expect to see the rs!SPNote of the first record ("012434")
but the watch displays the variable for rs!SPNote = "10193" which is the value of rs!SPNote of
the second record.
What am I doing wrong?
Thanks
with the debugger, I expect to see the rs!SPNote of the first record ("012434")
but the watch displays the variable for rs!SPNote = "10193" which is the value of rs!SPNote of
the second record.
What am I doing wrong?
Thanks
Code:
Dim rs As dao.Recordset
Dim LineNum As Integer
Dim newSPNote As String
Dim oldSPNote As String
LineNum = 0
oldSPNote = "-"
newSPNote = "-"
strSql = "Select * from SPnoteOrder_tbl order by LineNO"
Set rs = CurrentDb.OpenRecordset(strSql, dbOpenDynaset)
If Not (rs.BOF And rs.EOF) Then
rs.MoveFirst ' Get first record in Table
End If
Do While Not rs.EOF
newSPNote = rs!SPNote ' grab SPNote from record