specify custom toolbar for all reports in project?

  • Thread starter Thread starter John Noble
  • Start date Start date
J

John Noble

I'd like to specify a custom toolbar for every report in an Access2k project
but I don't want to manually go through and open each one to change the
'Toolbar' property. Is there a way to programmatically change the Toolbar
property for every report?

Thanks
John Noble
Network Office Clearinghouse
 
There may be a simpler way, but the below works for me.

Sub AllReports()
Dim obj As AccessObject, dbs As Object, rpt As Report

Set dbs = Application.CurrentProject

For Each obj In dbs.AllReports
DoCmd.OpenReport obj.Name, acViewDesign
For Each rpt In Reports
rpt.MenuBar = "My Menu Title"
Next rpt
DoCmd.close acReport, obj.Name, acSaveYes
Next obj

End Sub

Regards,
Glenn.
 
SORRY - Previous post was to change custom menu bar USE
This code.

Glenn.

There may be a simpler way, but the below works for me.

Sub AllReports()
Dim obj As AccessObject, dbs As Object, rpt As Report

Set dbs = Application.CurrentProject

For Each obj In dbs.AllReports
DoCmd.OpenReport obj.Name, acViewDesign
For Each rpt In Reports
rpt.Toolbar= "My Toolbar Title"
Next rpt
DoCmd.close acReport, obj.Name, acSaveYes
Next obj

End Sub

Regards,
Glenn.
 
Thanks!

I had tried a very similar procedure but missed the step of opening report,
changing the toolbar property and then closing the report.

John Noble
Network Office Clearinghouse
 
Back
Top