Access9001
Registered User.
- Local time
- Today, 00:04
- Joined
- Feb 18, 2010
- Messages
- 268
After opening a recordset in VBA I use this code to cycle through all fields of all records:
While Not rs.EOF
For i = 0 To rs.Fields.Count - 1
Set fld = rs.Fields(i)
Debug.Print fld.Name, rs(fld.Name)
Next i
rs.MoveNext
Wend
The problem is that some of the values display as null (say, rs("field2") of the third record even though if I open the query manually that cell has a value).
The funny thing is that if I make my query a make-table and then point my recordset to open that instead, the values magically display correctly. Why might this be happening? I need this query to spit out the right values as they are displayed in the query and NOT nulls!
While Not rs.EOF
For i = 0 To rs.Fields.Count - 1
Set fld = rs.Fields(i)
Debug.Print fld.Name, rs(fld.Name)
Next i
rs.MoveNext
Wend
The problem is that some of the values display as null (say, rs("field2") of the third record even though if I open the query manually that cell has a value).
The funny thing is that if I make my query a make-table and then point my recordset to open that instead, the values magically display correctly. Why might this be happening? I need this query to spit out the right values as they are displayed in the query and NOT nulls!