G
Guest
I'm using Access2000/VBA to create a collection of Reports for printing. I'm using a For/Next loop to step through AllReports and if the report Name begins with the right characters (i.e. "TR HP"), print it. The problem is, the reports need to be printed in Name sort order (i.e. "TR HP-4-01","TR HP-4-02", etc). Just looping through AllReports prints the collection in Index order. I'm familiar with arrays and Recordsets, but haven't actually used them much.
Any ideas on how to set this up
Current code
Dim obj As AccessObject, dbs As Objec
Set dbs = Application.CurrentProjec
For Each obj In dbs.AllReport
If Left(obj.Name, 5) = "TR HP" And Right(obj.Name, 6) <> "counts" The
DoCmd.OpenReport obj.Nam
End I
Next ob
Set dbs = Nothin
Many thanks
Carter
Any ideas on how to set this up
Current code
Dim obj As AccessObject, dbs As Objec
Set dbs = Application.CurrentProjec
For Each obj In dbs.AllReport
If Left(obj.Name, 5) = "TR HP" And Right(obj.Name, 6) <> "counts" The
DoCmd.OpenReport obj.Nam
End I
Next ob
Set dbs = Nothin
Many thanks
Carter