Setting a custom toolbar for all reports

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!
 
M

Marshall Barton

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
 
G

Guest

Worked like a charm. (Well, once I added DAO to my references it did.)
Thanks!


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


:

SNIP
 

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