acdsky,
I agree with what you have said and have done something similar.
I populate my list box with each table name field name then query the database with a statement:
"select distinct " & gstrF & " from " & gstrTB
Which gathers the distinct values within the user selected field (gstrF) from the user selected table (gstrTB).
But my problem is simply outputting those recordset values via a loop to a text file
. There is only one field in the recordset.
For i = 1 To rs.RecordCount - 1
strText = rs!variable
Write #1, strText
rs.MoveNext
Next
Where variable is the name of a string variable (gstrF) taken from the listbox selected field name - not a recordset field called variable
|