boblarson
Smeghead
- Local time
- Yesterday, 23:58
- Joined
- Jan 12, 2001
- Messages
- 32,040
I am at a bit of a standstill -
I am trying to figure out how to populate a listbox with the names of all of the available reports to run so that the user can select one and then run it.
I have come up with this code to find the names of all of the reports and the msgbox output looks fine. I am just at a loss to figure out how to plug that into the listbox.
Maybe there's an easier way also. Let me know if you have something that will help.
The code I have currently:
Dim obj As AccessObject, dbs As Object, strRpts As String
Set dbs = Application.CurrentProject
' Search for AccessObject objects in AllReports collection.
For Each obj In dbs.AllReports
strRpts = strRpts & vbCrLf & obj.Name
Next obj
MsgBox strRpts
Bob Larson

I am trying to figure out how to populate a listbox with the names of all of the available reports to run so that the user can select one and then run it.
I have come up with this code to find the names of all of the reports and the msgbox output looks fine. I am just at a loss to figure out how to plug that into the listbox.
Maybe there's an easier way also. Let me know if you have something that will help.
The code I have currently:
Dim obj As AccessObject, dbs As Object, strRpts As String
Set dbs = Application.CurrentProject
' Search for AccessObject objects in AllReports collection.
For Each obj In dbs.AllReports
strRpts = strRpts & vbCrLf & obj.Name
Next obj
MsgBox strRpts
Bob Larson