Published on:
Last updated:

This post is also available in: Japanese


Function GetFileNames() As String
  Dim cd As Object
  Dim cp As Object
  Dim tbl As AccessObject
  Dim qry As AccessObject
  Dim frm As AccessObject
  Dim rpt As AccessObject

  Set cd = Application.CurrentData
  Set cp = Application.CurrentProject

  Debug.Print "Table Names:"
  For Each tbl In cd.AllTables
      Debug.Print tbl.Name
  Next tbl

  Debug.Print "Query Names:"
  For Each qry In cd.AllQueries
      Debug.Print qry.Name
  Next qry

  Debug.Print "Form Names:"
  For Each frm In cp.AllForms
      Debug.Print frm.Name
  Next frm

  Debug.Print "Report Names:"
  For Each rpt In cp.AllReports
      Debug.Print rpt.Name
  Next rpt
End Function

Kuniyoshi Takemoto is the founder of LLC, and editor of this blog( more and follow me on LinkedIn.