Caption Property of a Field

  • Thread starter Thread starter Matthew Pfluger
  • Start date Start date
M

Matthew Pfluger

Is there a way to retrieve the Caption of a Table or Query field through VBA?

Thanks,
Pflugs
 
Is there a way to retrieve the Caption of a Table or Query field through VBA?

Thanks,
Pflugs

Here's Tables.....

Public Sub ShowCaptions()
On Error GoTo Err_Handler
Dim db As DAO.Database
Dim tbl As TableDef
Dim fld As Field

Set db = CurrentDb
For Each tbl In db.TableDefs

On Error GoTo Err_Handler
Debug.Print tbl.Name
For Each fld In tbl.Fields
Debug.Print fld.Name & " " & fld.Properties("Caption")
Next fld
Next tbl
Exit_ShowCaptions:
Set db = Nothing
Exit Sub
Err_Handler:
Resume Next

End Sub
 
Back
Top