This is a bit strange, and hoping to get some understanding on what is happening.
I have a very simple bit of code that goes thru a Recodeset
Sometimes (and i mean sometimes) rs!Name returns a NULL, and I get "Invalid use of Null".
But, if I debug the code, and continue it running, rs!Age does not return a NULL.
If I run it again, the point (the iterartion) at which I get the error changes.
Is there something I'm not setting up properly?
Dim rs As DAO.Recordset
Set rs = Me.RecordsetClone
rs.MoveLast
rs.MoveFirst
NumberPeople = rs.RecordCount
'I then have a for loop that that goes thru each record.
For i = 1 To NumberPeople
CurrentName = rs!Name
CurrentAge = rs!Age
......Do something etc.
rs.MoveNext
Next i
Thanks.
I have a very simple bit of code that goes thru a Recodeset
Sometimes (and i mean sometimes) rs!Name returns a NULL, and I get "Invalid use of Null".
But, if I debug the code, and continue it running, rs!Age does not return a NULL.
If I run it again, the point (the iterartion) at which I get the error changes.
Is there something I'm not setting up properly?
Dim rs As DAO.Recordset
Set rs = Me.RecordsetClone
rs.MoveLast
rs.MoveFirst
NumberPeople = rs.RecordCount
'I then have a for loop that that goes thru each record.
For i = 1 To NumberPeople
CurrentName = rs!Name
CurrentAge = rs!Age
......Do something etc.
rs.MoveNext
Next i
Thanks.