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

  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

  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

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

Figure D

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.


Miss an Access tip?

Check out the Microsoft Access archive and catch up on other Access tips.

Help users increase productivity by automatically signing up for TechRepublic’s free Microsoft Office Suite newsletter, featuring Word, Excel, and Access tips, delivered each Wednesday.