so if i do a SQL statement like so:
sql = "SELECT * FROM tblMain"
set rs = currentdb.openrecordset(sql)
what method can i use to view every “field name” in this collection i have just created. i am getting some very strange error stating that the item is not found in this collection.
i know the field exists in the table, i have triple checked the spelling everywhere when i reference it, and the SQL should be pulling everything, but i want to see it.
is there a debug.print method to see all these fields
thanks
Justin
You can iterate through the fields collection of the recordset.
Code is OTTOMH
Alternately, you can set a breakpoint at
set rs = currentdb.openrecordset(sql)and then as soon as the statement executes, right-click onrs, choose add watch and view the whole thing in the Watches window.