February 19, 2009

Use a form to display a list of reports and queries in an Access database

  • Date: December 9th, 2008
  • Author: Mary Ann Richardson

When you need to know what objects are being created for a database, you can run generic soft tabs cialis a query against an Access system table to generate a list of all current reports and queries.


Ever wonder exactly what reports and queries are being created for a database? As an administrator, you may need a quick way of determining what reports and queries are being run against a database. Fortunately, Access stores the names of all the top-level database objects in a system table called MSysObjects. You can run queries against MSysObjects just as you would any other table in the database.  Follow these steps:

  1. Open the database and create a form with two unbound list boxes, as shown in Figure A.

Figure A

two unbound boxes

  1. In Design view, right-click the first list box and select Properties.
  2. Under the Data tab, right-click the RowSource property box and select Zoom.
  3. Enter the code as shown in Figure B and click Close.

Figure B

rowsource property

  1. Right-click the second list box and select Properties.
  2. Under the Data tab, right-click the RowSource property box and select Zoom.
  3. Enter the code as shown in Figure C.

Figure C

queries

When you run the form, Access outputs all current reports and queries for that database to the respective list boxes (Figure D).

Figure D

object query

To access other object types, use their type value. For example, to list all the tables in the database, enter 6. To list forms, enter -32768. To list macros, enter -32766.

Permalink • Print • Comment

Leave a comment

You must be logged in to post a comment.

Made with WordPress and a healthy dose of Semiologic • Sky Gold skin by Denis de Bernardy