Query Table Field Names

Posted on 2013-09-19
Medium Priority
Last Modified: 2013-09-19
Is it possible to query any table and get the field names back?
Question by:patriotpacer
LVL 61

Accepted Solution

mbizup earned 2000 total points
ID: 39505820
I don't think you can do that with straight SQL, but with VBA:

Dim rs as DAO.Recordset
Dim fld as Field

set rs = CurrentDB.OpenRecordset("YourTableName") 
For Each fld in rs.Fields
      Debug.Print fld.Name
set rs = nothing

Open in new window


Author Closing Comment

ID: 39505911
Thank you.

Kind of what I thought.

Featured Post

Easily Design & Build Your Next Website

Squarespace’s all-in-one platform gives you everything you need to express yourself creatively online, whether it is with a domain, website, or online store. Get started with your free trial today, and when ready, take 10% off your first purchase with offer code 'EXPERTS'.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

If you’re using QODBC to update QuickBooks data from Microsoft® Access but Access is not showing the updated data, you could have set up QODBC incorrectly.
Audit trails are very important in any system to hold people responsible for certain transactions and hold them to take ownership of their actions. This article is dedicated to all novice "Microsoft Access" developers.
With Microsoft Access, learn how to start a database in different ways and produce different start-up actions allowing you to use a single database to perform multiple tasks. Specify a start-up form through options: Specify an Autoexec macro: Us…
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …

586 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question