![]() | |
![]() |
| | Thread Tools | Display Modes |
#11
| |||
| |||
|
|
paii, Ron wrote: "Salad" <salad (AT) oilandvinegar (DOT) com> wrote in message news:_pGdnYr5KbepjhzRnZ2dnUVZ_gGdnZ2d (AT) earthlink (DOT) com... paii, Ron wrote: "Salad" <salad (AT) oilandvinegar (DOT) com> wrote in message news:zoadnZOCbNhNoB3RnZ2dnUVZ_r6dnZ2d (AT) earthlink (DOT) com... paii, Ron wrote: I am using the following code to replace the toolbar on all my reports with a custom ribbon. It adds the ribbon but will not delete the toolbar. How can I delete the reference to the old custom toolbar? Dim rpt As AccessObject Dim i As Integer For Each rpt In CurrentProject.AllReports DoCmd.OpenReport rpt.Name, acViewDesign, , , acHidden Reports(rpt.Name).RibbonName = "PrintPrev" Reports(rpt.Name).Toolbar = "" DoCmd.Close acReport, rpt.Name, acSaveYes Next Any possibility it's the Menubar, not Toolbar, that needs to be updated? I just tried that and it did not work. I also tried Reports(rpt.Name).Toolbar = "x", thinking Toolbar would not accept ZLS, but NG. As a test I did Reports(rpt.Name).Menubar = "y", which set the menubar to "y". This is throwing mud at the wall hoping something sticks. Sub r() Dim dbs As Database Dim doc As Document Dim rpt As Report Set dbs = CurrentDb With dbs.Containers!Reports For Each doc In .Documents DoCmd.OpenReport doc.Name, acViewDesign Set rpt = Reports(doc.Name) MsgBox doc.Name & " " & rpt.Toolbar rpt.Toolbar = "" Set rpt = Nothing DoCmd.Close acReport, doc.Name, acSaveYes Exit For 'test on one report, remove if works Next End With End Sub I tried your code, as you expected, it did not work. By the way, this is for Access 2010. Thanks for the help If you do it manually does that help? |
#12
| |||
| |||
|
|
paii, Ron wrote: "Salad" <salad (AT) oilandvinegar (DOT) com> wrote in message news:zoadnZOCbNhNoB3RnZ2dnUVZ_r6dnZ2d (AT) earthlink (DOT) com... paii, Ron wrote: I am using the following code to replace the toolbar on all my reports with a custom ribbon. It adds the ribbon but will not delete the toolbar. How can I delete the reference to the old custom toolbar? Dim rpt As AccessObject Dim i As Integer For Each rpt In CurrentProject.AllReports DoCmd.OpenReport rpt.Name, acViewDesign, , , acHidden Reports(rpt.Name).RibbonName = "PrintPrev" Reports(rpt.Name).Toolbar = "" DoCmd.Close acReport, rpt.Name, acSaveYes Next Any possibility it's the Menubar, not Toolbar, that needs to be updated? I just tried that and it did not work. I also tried Reports(rpt.Name).Toolbar = "x", thinking Toolbar would not accept ZLS, but NG. As a test I did Reports(rpt.Name).Menubar = "y", which set the menubar to "y". This is throwing mud at the wall hoping something sticks. Sub r() Dim dbs As Database Dim doc As Document Dim rpt As Report Set dbs = CurrentDb With dbs.Containers!Reports For Each doc In .Documents DoCmd.OpenReport doc.Name, acViewDesign Set rpt = Reports(doc.Name) MsgBox doc.Name & " " & rpt.Toolbar rpt.Toolbar = "" Set rpt = Nothing DoCmd.Close acReport, doc.Name, acSaveYes Exit For 'test on one report, remove if works Next End With End Sub |
![]() |
| Thread Tools | |
| Display Modes | |
| |