Access Macro 3 : Know the Names of all the Tables, Forms, Reports and Queries in Db

39 views
Skip to first unread message

ashish koul

unread,
Jun 30, 2012, 4:43:21 PM6/30/12
to accessv...@googlegroups.com
Know forms names in Access Database

Option Compare Database
Sub form_names()
Dim obs As Object
For Each obj In Application.CurrentProject.AllForms
MsgBox obj.Name
found = True
Next
End Sub


Know table names in Access Database

Sub table_names()
Dim tbl As DAO.TableDef
For Each tbl In CurrentDb.TableDefs
If tbl.Attributes = 0 Then
MsgBox tbl.Name
End If
Next
End Sub


Know Report Names in Access Database

Sub reportnames()
Dim rpt As Object
For Each rpt In Application.CurrentProject.AllReports
MsgBox rpt.Name
Next
End Sub



Know Query Names in Access Database

Sub querynames()
Dim QRY As DAO.QueryDef
For Each QRY In CurrentDb.QueryDefs
If Left(QRY.Name, 1) <> "~" Then
MsgBox QRY.Name
End If
Next
End Sub


Reply all
Reply to author
Forward
0 new messages