Hi,
I finally found an easier way to list all the reports in the Access database instead of showing so many different forms to list the reports.
However, I am stuck into showing and listing the reports in the list box.
Here is the code in the Form_Load,
Private Sub Form_Load()
Dim objAO As AccessObject
Dim objCP As Object
Dim strValues As String
Set objCP = Application.CurrentProject
For Each objAO In objCP.AllReports
strValues = strValues & objAO.Name & ";"
Next objAO
lstReports.RowSourceType = "Value List"
lstReports.RowSource = strValues
End Sub
Here are the questions,
~I only want to show the main reports and no need to show those subreports that have the name beginning on srpt_xxx. Can I not show them in the List Box?
~Then I want to show the reports in ascending order.
~Is it workable?
Thanks you very much.
I finally found an easier way to list all the reports in the Access database instead of showing so many different forms to list the reports.
However, I am stuck into showing and listing the reports in the list box.
Here is the code in the Form_Load,
Private Sub Form_Load()
Dim objAO As AccessObject
Dim objCP As Object
Dim strValues As String
Set objCP = Application.CurrentProject
For Each objAO In objCP.AllReports
strValues = strValues & objAO.Name & ";"
Next objAO
lstReports.RowSourceType = "Value List"
lstReports.RowSource = strValues
End Sub
Here are the questions,
~I only want to show the main reports and no need to show those subreports that have the name beginning on srpt_xxx. Can I not show them in the List Box?
~Then I want to show the reports in ascending order.
~Is it workable?
Thanks you very much.