Solved

Printing a List of Acess Forms

Posted on 2014-04-22
3
308 Views
Last Modified: 2014-04-22
Hi Experts,

Is there any quick way that I can print out a list of Access forms that are within a .accdb file?

I don't need anything fancy just a quick list.

Thank you,
0
Comment
Question by:APD_Toronto
3 Comments
 
LVL 12

Accepted Solution

by:
pdebaets earned 500 total points
ID: 40016143
From the OnClick event procedure of a command button on a form:

Dim i As Integer
With CodeProject
For i = 0 To .AllForms.Count - 1
    Debug.Print .AllForms(i).Name
Next i
End With

Open in new window


The output will show up in the Immediate Window. Press Ctrl-G while editing Visual Basic code to see the Immediate Window.
0
 
LVL 120

Expert Comment

by:Rey Obrero (Capricorn1)
ID: 40016149
test this

Sub ListForms()
Dim db As database
Dim d As Document
Dim C As Container
Set db = CurrentDb()
Set C = db.Containers("Forms")
For Each d In C.Documents
    Debug.Print d.Name
Next d
End Sub
0
 
LVL 35

Expert Comment

by:PatHartman
ID: 40016173
You can use a query which gives you some flexibility on how you use the output.

SELECT MSysObjects.Name, MSysObjects.Type
FROM MSysObjects
WHERE (((MSysObjects.Type)=-32768))
ORDER BY MSysObjects.Name;


If you can't see the MSys tables, you can show them by going to Navigation Options and checking the Show System Objects box.

Each object type has a unique type code.  The MSys tables are not documented but if you have a database with a variety of objects, you should be able to see most of the available types.  Here's a list from my explorations:
Type      TypeDesc
-32768      Form
-32766      Macro
-32764      Reports
-32761      Module
-32758      Users
-32757      Database Document
-32756      Data Access Pages
1      Table - Local Access Tables
2      Access Object - Database
3      Access Object - Containers
4      Table - Linked ODBC Tables
5      Queries
6      Table - Linked Access Tables
8      Relationships
9      Constraints
0

Featured Post

Ransomware-A Revenue Bonanza for Service Providers

Ransomware – malware that gets on your customers’ computers, encrypts their data, and extorts a hefty ransom for the decryption keys – is a surging new threat.  The purpose of this eBook is to educate the reader about ransomware attacks.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In the previous article, Using a Critera Form to Filter Records (http://www.experts-exchange.com/A_6069.html), the form was basically a data container storing user input, which queries and other database objects could read. The form had to remain op…
When you are entering numbers in a speadsheet, and don't remember what 6×7 is, you just type “=6*7" instead. It works in every cell! This is not so in Access. To enter the elusive 42 in a text box, you have to find a calculator, and then copy the re…
With Microsoft Access, learn how to start a database in different ways and produce different start-up actions allowing you to use a single database to perform multiple tasks. Specify a start-up form through options: Specify an Autoexec macro: Us…
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

777 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question