How to get number of fields in a table or query?

M

muster

Hi,

I haven't used Access for years, this is a simple question, when I
write a query I sometimes want to know how many columns I chose, is
there a easy way?

Thank you,
Muster
 
G

Guest

In the debug window (aka immediate window) enter:

? CurrentDb.QueryDefs("YourQueryName").Fields.Count

substituting the name of the query in question. To open the debug window
press Ctrl + G. For a table use:

? CurrentDb.TableDefs("YourTableName").Fields.Count

Ken Sheridan
Stafford, England
 
S

SJ

You could count them...

or maybe you could post the select syntax into a text editor and get it to
count the commas, there is probably a relationship between the number of
commas and the number of fields.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top