Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Print Table, Query, Form,Report and Macro names 1

Status
Not open for further replies.

dvannoy

MIS
May 4, 2001
2,765
US
Is there any way to get a print out of all the Names of each table form etc...I dont want a print out of all the fields just the names...Setting up security is tough when there is so many table names etc..As you all know it cuts off the names when setting up security..

Thanks in Advance DVannoy
A+,Network+,CNA
dvannoy@onyxes.com
 
You could do this in vba code using the TableDef collection like below (probably wouldn't want to do it with a message box though, but...for simplicity's sake...) Or you could just directly query the MSysObjects table (name & type). Each different object type will have a different type value. Be careful that you don't accidentally update the MSysObjects table or you'll cause problems.

Dim dbs As Database
Dim tdf As TableDef

Set dbs = CurrentDb
dbs.TableDefs.Refresh
With dbs
For Each tdf In dbs.TableDefs
MsgBox (tdf.Name)
Next tdf
.Close
End With
End Sub

Hope this helps...

jj
jjones@cybrtyme.com




 
Where would this code go..behind a button or on a report?

Thanks for your help DVannoy
A+,Network+,CNA
dvannoy@onyxes.com
 
The code is just a sample that would go behind a button & display a message box each displaying each table name, if you need to generate a complete list, the easiest method would probably just be to query the MSysObjects table. If you don't see this table in your database window, go to the Tools | Options menu and select the checkbox to Show System Objects.

Then, you can write a query against this table (use the name field and the type field where type equals number assigned to the type of objects you want a list of).

Good luck! J. Jones
jjones@cybrtyme.com
 
jjonesal example will work. Getting to the forms, reports and modules is a little tricker. If you reference these collection, they only give you a list of what's open.

This is out of the help:
Code:
Document        Container	Contains information about
Form	        Forms	        Saved form
Macro	        Scripts	        Saved macro
Module	        Modules	        Saved module
Report	        Reports	        Saved report
SummaryInfo	Databases	Database document summary
UserDefined	Databases	User-defined properties

Go to the object browser (F2 in the VBE) and search for document of container... Tyrone Lumley
augerinn@gte.net
 
This may be late, but I can remember my greatest problem as a newbie was getting a printout of my table and field structures without sending a copy of the form to the printer. One day out of desperation I found the Tools|Analyze|Documentor function. By setting the options, you can get the information you need in a very nice printout.

mac318
 
This may be late, but I can remember my greatest problem as a newbie was getting a printout of my table and field structures without sending a copy of the form to the printer. One day out of desperation I found the Tools|Analyze|Documentor Menu Item. By setting the options, you can get the information you need in a very nice printout.

mac318
 
Sorry for the double post; but, I thought I had successfully stopped the post, in order to, correct an error.

mac318
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top