Solved

Printing a List of Acess Forms

Posted on 2014-04-22
3
306 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
Comment Utility
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 119

Expert Comment

by:Rey Obrero
Comment Utility
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 34

Expert Comment

by:PatHartman
Comment Utility
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

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

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…
In a multiple monitor setup, if you don't want to use AutoCenter to position your popup forms, you have a problem: where will they appear?  Sometimes you may have an additional problem: where the devil did they go?  If you last had a popup form open…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
Using Microsoft Access, learn some simple rules for how to construct tables in a relational database. Split up all multi-value fields into single values: Split up fields that belong to other things into separate tables: Make sure that all record…

763 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

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now