I have an Access Database that I am trying to list reports that can be run in a Listbox that is linked by the control source to a table. When a report is clicked on I want it to come up with Output To selection. I am using this code to do that: DoCmd.OpenReport List32, acViewPreview
I am also using code to bring in a list. The only problem is it's listing all reports in the database.
Here is that code:
Private Sub Form_Open(Cancel As Integer)
Dim intNumOfReports As Integer
Dim intRptCounter As Integer
Dim str As String
intNumOfReports = CurrentDb.Containers("Reports").Documents.Count
If intNumOfReports <> 0 Then
Me![List32].RowSourceType = "Value List"
For intRptCounter = 0 To intNumOfReports - 1
str = str & CurrentDb.Containers("Reports").Documents(intRptCounter).Name & ";"
Next
Me![List32].RowSource = Left$(str, Len(str) - 1)
End If
End Sub
Thank for any help!
I am also using code to bring in a list. The only problem is it's listing all reports in the database.
Here is that code:
Private Sub Form_Open(Cancel As Integer)
Dim intNumOfReports As Integer
Dim intRptCounter As Integer
Dim str As String
intNumOfReports = CurrentDb.Containers("Reports").Documents.Count
If intNumOfReports <> 0 Then
Me![List32].RowSourceType = "Value List"
For intRptCounter = 0 To intNumOfReports - 1
str = str & CurrentDb.Containers("Reports").Documents(intRptCounter).Name & ";"
Next
Me![List32].RowSource = Left$(str, Len(str) - 1)
End If
End Sub
Thank for any help!