Solved

Printing a List of Acess Forms

Posted on 2014-04-22
3
311 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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 37

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

Simplifying Server Workload Migrations

This use case outlines the migration challenges that organizations face and how the Acronis AnyData Engine supports physical-to-physical (P2P), physical-to-virtual (P2V), virtual to physical (V2P), and cross-virtual (V2V) migration scenarios to address these challenges.

Question has a verified solution.

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

This article describes a method of delivering Word templates for use in merging Access data to Word documents, that requires no computer knowledge on the part of the recipient -- the templates are saved in table fields, and are extracted and install…
Traditionally, the method to display pictures in Access forms and reports is to first download them from URLs to a folder, record the path in a table and then let the form or report pull the pictures from that folder. But why not let Windows retr…
In Microsoft Access, learn how to use Dlookup and other domain aggregate functions and one method of specifying a string value within a string. Specify the first argument, which is the expression to be returned: Specify the second argument, which …
With Microsoft Access, learn how to specify relationships between tables and set various options on the relationship. Add the tables: Create the relationship: Decide if you’re going to set referential integrity: Decide if you want cascade upda…

705 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