Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Can I return the fieldname rather than the value from a recordset

Status
Not open for further replies.

jacq

Technical User
Jan 3, 2001
38
GB
I need to get the field names rather than the values from a table. I have tried creating a recordset to get the field name using .name or .field but I keep getting errors. Is there a way to get the names using a recordset or should I be trying another approach?
 
try this:

dim rs as recordset
dim f as field
set rs=currentdb.openrecordset("table1")
for each f in rs.fields
debug.print f.name
next f
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top