I
imstuck via AccessMonster.com
i have this code on my list box:
This displays all the reports i have with "rpt" & "rpf" word at the beginning
of the report name.
Private Sub Form_Open(Cancel As Integer)
Dim objAO As AccessObject
Dim objCP As Object
Dim strValues As String
Set objCP = Application.CurrentProject
For Each objAO In objCP.AllReports
If Left(objAO.Name, 3) = "rpt" Or Left(objAO.Name, 3) = "rpf" Then
strValues = strValues & Mid(objAO.Name, 4) & ";" & Left(objAO.Name, 3)
& ";"
End If
Next objAO
lstReports.RowSourceType = "Value List"
lstReports.RowSource = strValues
End Sub
my problem is, i want to display the reports in alphabetical order. How can i
do that?
thanks
This displays all the reports i have with "rpt" & "rpf" word at the beginning
of the report name.
Private Sub Form_Open(Cancel As Integer)
Dim objAO As AccessObject
Dim objCP As Object
Dim strValues As String
Set objCP = Application.CurrentProject
For Each objAO In objCP.AllReports
If Left(objAO.Name, 3) = "rpt" Or Left(objAO.Name, 3) = "rpf" Then
strValues = strValues & Mid(objAO.Name, 4) & ";" & Left(objAO.Name, 3)
& ";"
End If
Next objAO
lstReports.RowSourceType = "Value List"
lstReports.RowSource = strValues
End Sub
my problem is, i want to display the reports in alphabetical order. How can i
do that?
thanks