specify custom toolbar for all reports in project?

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
 
G

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.MenuBar = "My Menu Title"
Next rpt
DoCmd.close acReport, obj.Name, acSaveYes
Next obj

End Sub

Regards,
Glenn.
 
G

Guest

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.
 
J

John Noble

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top