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

  • Thread starter Thread starter muster
  • Start date Start date
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
 
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
 
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.
 
Back
Top