By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,477 Members | 1,602 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,477 IT Pros & Developers. It's quick & easy.

List of All Forms in Database

P: n/a
I have a db with about 75 forms. I am trying to tidy it up and would
like to print out a list of all the forms to help in the process. I
have looked at the HELP section for VBA and found some code:

Sub AllForms()
Dim obj As AccessObject, dbs As Object
Set dbs = Application.CurrentProject
' Search for open AccessObject objects in AllForms collection.
For Each obj In dbs.AllForms
' If obj.IsLoaded = True Then
' Print name of obj.
Debug.Print obj.Name
' End If
Next obj
End Sub

This prints wonderfully well in the immediate window but I have no
idea how to make it print on a report.

Any help would be gratefully appreciated. I have spent about 3 hours
trying to solve this without success. Apologies to the experts to
whom this seems a dumb question.

I am using MS Access 2000
Aug 13 '08 #1
Share this Question
Share on Google+
5 Replies


P: n/a
po**@vincentoakley.com wrote:
I have a db with about 75 forms. I am trying to tidy it up and would
like to print out a list of all the forms to help in the process. I
have looked at the HELP section for VBA and found some code:

Sub AllForms()
Dim obj As AccessObject, dbs As Object
Set dbs = Application.CurrentProject
' Search for open AccessObject objects in AllForms collection.
For Each obj In dbs.AllForms
' If obj.IsLoaded = True Then
' Print name of obj.
Debug.Print obj.Name
' End If
Next obj
End Sub

This prints wonderfully well in the immediate window but I have no
idea how to make it print on a report.

Any help would be gratefully appreciated. I have spent about 3 hours
trying to solve this without success. Apologies to the experts to
whom this seems a dumb question.

I am using MS Access 2000
Why don't you add the form names to a table you create to hold form
names? Then use a report to list them.
Aug 13 '08 #2

P: n/a
po**@vincentoakley.com a écrit, le 13/08/2008 22:18 :
This prints wonderfully well in the immediate window but I have no
idea how to make it print on a report.
Hello, you can add

at the beginning
Open "Outfile.txt" For Output As #1

in the loop (in place of Debug.Print)
Print #1, obj.Name
at the end
Close #1
You will obtain all the names in a text file. You can then import it in
a report, or maybe Word is a better tool to format that.

Please note that in place of "Outfile.txt" you can place a full path.
Otherwise, you get the file in the default directory (CurDir if I
remember well).
Aug 13 '08 #3

P: n/a
From the task you've set yourself, you might want to look at the built in
Documenter. Goto Tools - Analyze - Documenter.

You can pick what you want included in the report ,using the "Options" button.
You can include such things as controls, relationships and so forth.

--
There's ALWAYS more than one way to skin a cat!

Answers/posts based on Access 2000/2003

Message posted via AccessMonster.com
http://www.accessmonster.com/Uwe/For...ccess/200808/1

Aug 14 '08 #4

P: n/a
Tools | Analysis | Database Documenter will allow you to print a list of the
Forms, with some options in data to be shown.

Larry
"Gloops" <gl****@invalid.zailes.orgwrote
This prints wonderfully well in the immediate
window but I have no idea how to make it print
on a report.
Hello, you can add

at the beginning
Open "Outfile.txt" For Output As #1

in the loop (in place of Debug.Print)
Print #1, obj.Name
at the end
Close #1
You will obtain all the names in a text file. You can then import it in
a report, or maybe Word is a better tool to format that.

Please note that in place of "Outfile.txt" you can place a full path.
Otherwise, you get the file in the default directory (CurDir if I
remember well).
Aug 16 '08 #5

P: n/a
Perhaps the form names are in a table, MSysObjects, ready for use?

SELECT [Name] FROM MSysObjects WHERE Type = -32768

On Aug 13, 4:32*pm, Salad <o...@vinegar.comwrote:
Why don't you add the form names to a table you create to hold form
names? *Then use a report to list them.
Aug 16 '08 #6

This discussion thread is closed

Replies have been disabled for this discussion.