Setting a custom toolbar for all reports

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I've got a custom print preview toolbar I'd like to use on all the reports in
a database. Is there a way to set the toolbar property for these reports all
at once rather than open each report in design view and change one report at
a time?

I've tried accessing the Toolbar property through the AllReports collection
in VB but I haven't had any success. I'm sure there's a way to do it there,
but it's not clear to me how I get there.

Thanks in advance for your help!
 
Nick said:
I've got a custom print preview toolbar I'd like to use on all the reports in
a database. Is there a way to set the toolbar property for these reports all
at once rather than open each report in design view and change one report at
a time?

I've tried accessing the Toolbar property through the AllReports collection
in VB but I haven't had any success. I'm sure there's a way to do it there,
but it's not clear to me how I get there.


You must do them one at a time, but you can automate the
process:

Dim db As Database
Dim Rpt As Document
Set db = CurrentDb()
For Each rpt In db.Containers!Reports.Documents
DoCmd.OpenReport rpt.Nane, acViewDesign
Reports(rpt.Name).Toolbar = "mytoobar"
DoCmd.Close acReport, rpt.Name, acSaveYes
Next rpt
Set db = Nothing
 
Worked like a charm. (Well, once I added DAO to my references it did.)
Thanks!


--
Madness takes its toll. Please have exact change.


:

SNIP
 
Back
Top