Hi,
I have a combo box on a switchboard form that lists all of the reports in the database alphabetically. The code looks like this:
Private Sub Form_Load()
Dim knt As Integer
Dim i As Integer
Dim j As Integer
Dim aryNames() As String
Dim temp As String
Dim values As String
knt = CurrentProject.AllReports.Count - 1
ReDim aryNames(knt)
For i = 0 To knt
aryNames(i) = CurrentProject.AllReports(i).Name
Next
'Sort the names
For i = 1 To Knt
For j = 0 To knt - i
If aryNames(j) > aryNames(j + 1) Then
temp = aryNames(j)
aryNames(j) = aryNames(j + 1)
aryNames(j + 1) = temp
End If
Next
values = ";" & aryNames(j) & values
Next
values = aryNames(0) & values
lstReports.RowSourceType = "value list"
lstReports.RowSource = values
End Sub
It works great except there are some reports, like subreports, that I would like to leave out. If I gave them all specific prefixes like ZZNameofReport, is there a way to filter them out of the list? Also, there is more info about this on my original post: thread702-534808
Thanks for any help!
I have a combo box on a switchboard form that lists all of the reports in the database alphabetically. The code looks like this:
Private Sub Form_Load()
Dim knt As Integer
Dim i As Integer
Dim j As Integer
Dim aryNames() As String
Dim temp As String
Dim values As String
knt = CurrentProject.AllReports.Count - 1
ReDim aryNames(knt)
For i = 0 To knt
aryNames(i) = CurrentProject.AllReports(i).Name
Next
'Sort the names
For i = 1 To Knt
For j = 0 To knt - i
If aryNames(j) > aryNames(j + 1) Then
temp = aryNames(j)
aryNames(j) = aryNames(j + 1)
aryNames(j + 1) = temp
End If
Next
values = ";" & aryNames(j) & values
Next
values = aryNames(0) & values
lstReports.RowSourceType = "value list"
lstReports.RowSource = values
End Sub
It works great except there are some reports, like subreports, that I would like to leave out. If I gave them all specific prefixes like ZZNameofReport, is there a way to filter them out of the list? Also, there is more info about this on my original post: thread702-534808
Thanks for any help!