We help IT Professionals succeed at work.

Amount of fields in Access table

Gilberto Sanches
Gilberto Sanches used Ask the Experts™
on
How easily see the amounts of fields of a Access table?
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Daniel PineaultPresident / Owner CARDA Consultants Inc.
Distinguished Expert 2018

Commented:
CurrentDb.TableDefs("YourTableName").Fields.Count

Open in new window

NoahHardware Tester and Debugger

Commented:
Hi there! :)

You may also try something like this. You need to change "Table1" in this code to your actual table name.

Dim obj As DAO.Recordset
Set obj = CurrentDb.OpenRecordset("SELECT * FROM Table1")
obj.MoveLast

MsgBox ("There are " & obj.RecordCount & " records")

MsgBox ("There are" & obj.Fields.Count & " table")

Open in new window

Freelance ICT Consultant
Commented:
Thanks Daniel & Noah.

My quick solution was to copy paste 1 record of the table to Google Sheet / Excel. Then use the Google Sheets formula, counta, to count the headers of the pasted table.