[RESOLVED] Getting Records from an ADO RecordSet
I have a DAO RecordSet object which holds all records from a field. I am attempting to get the names of the records from the RecordSet, but am unable to do so. Here is the code I have so far:
strTable is a table name
fld is a Field object
Code:
Dim fldRecordSet As DAO.recordSet
Set fldRecordSet = database.OpenRecordset("SELECT DISTINCT " & strTable &".[" & fld.name & "] FROM " & strTable)
I know the recordSet has data, the count was 1086 or something close to that. I just dont know how to get the record names from the recordset. Thanks for any help!
Re: Getting Records from an ADO RecordSet
This may not be exact, but something along these lines should help. You'll obviously have to change things depending on what you want to do with the data - I'm just sticking it in a string variable.
Code:
Dim strFieldData as String
Do While Not fldRecordSet.EOF
strFieldData = fldRecordSet.Fields(fld.name).Value
fldRecordSet.MoveNext
Loop
Re: Getting Records from an ADO RecordSet
That got me in the right direction. Thanks!