Hi, I have a database with almost 20 reports, so i need to put all these reports on a Drop-down list or a Combo Box, so once i selet any report from the Combo Box it opens up.
You can use a combo box or a list box to do this. Below is a sample using a combo box.
Here I am using the On Current event of the form to populate the combo box.
Private Sub Form_Current()
Dim dbs As Database
Set dbs = CurrentDb
Dim ctr As Container
Dim cboList As String
Dim doc As Document
cboList = ""
Set ctr = dbs.Containers("Reports")
'build the value list for Reports
For Each doc In ctr.Documents
Debug.Print doc.Name
cboList = cboList & doc.Name & ";"
Next
'Load the Combo Box box
cboList = Left(cboList, Len(cboList) - 1) 'truncate the last semicolon
cboReports.RowSourceType = "Value List"
cboReports.RowSource = cboList
End Sub