Open System Reports from a Form

Clownfish1980m

Clownfish8182m
Local time
Today, 08:32
Joined
Sep 18, 2009
Messages
40
:) Working with access and the great folks on this forum to get assistance as well as great ideas for adding features to database design, I just want to share what I was able to accomplish in hopes it will help others wanting to do the same.

I created a list box to show all the available reports created in Mysys. To do this, I created a blank list box and entered the code below as the RowSource:

SELECT [Name] FROM MsysObjects
WHERE (([Type] = -32764) AND ([Name] Not Like "~*") AND ([Name] Not Like "MSys*"))
ORDER BY [Name];

To query other object types you can change the -32764:

Table
1
Query
5
Form
-32768
Report
-32764
Module
-32761


The next thing I did was add a command button on a form to open a report. You build it to open any report on your system. Then go into the event procedure and change the stDocNeme to [Name of List box].

When the user wants to select a report they use the scroll button to identify the report, click on the report to select it, then click on the command button to open the report.


Ken
 

Users who are viewing this thread

Back
Top Bottom