So I assume you got the issue in thread702-768174 straightened out. Try moving to the last record to get the full count of your recordset. i.e. rst.MoveLast then do a count
I just did this:
Function CountFields()
Dim db As DAO.Database
Dim rst As DAO.Recordset
Dim strsql As String
Set db = CurrentDb
strsql = "select * from assess"
Set rst = db.OpenRecordset(strsql, dbOpenSnapshot)
Debug.Print rst.Fields.Count
End Function
and it gave me an accurate count. Are you sure that's the sql? Are you sure there's more than one field in the table? Are you sure you're returning a legit recordset? Are you using ADO? (Might be different, I don't know)
Please post in the appropriate forum with a descriptive subject; code and SQL, if referenced; and expected results. See thread181-473997 for more pointers.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.