- Add a list or combo box to a form and name the control lstReports.
- Set the control's Row Source Type property to Value List.
- Click the Code button to launch the form's module.
- Enter the following code:
Private Sub Form_Load()
'Populate lstReports with the name
'of all the reports in the database.
Dim ao As AccessObject
For Each ao In CurrentProject.AllReports
End SubOpening the form in Form view executes the form's Load event. The For loop cycles through the reports in the AllReports collection, which contains objects that describe instances of all the reports in the database.
Susan Sales Harkins is an IT consultant, specializing in desktop solutions. Previously, she was editor in chief for The Cobb Group, the world's largest publisher of technical journals.