TableDef in Access2003

C

Clueless

Hi,
I'm trying to figure out how to enumerate the fields in a table in a
current database from vba. The documentation seems to suggest it's possible
but only details how not to do it.
 
B

Brendan Reynolds

Public Sub ListFields(ByVal strTableName As String)

Dim fld As DAO.Field
Dim db As DAO.Database
Set db = CurrentDb
For Each fld In db.TableDefs(strTableName).Fields
Debug.Print fld.Name
Next fld

End Sub
 

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