![]() | |
![]() |
| | Thread Tools | Display Modes |
#1
| |||
| |||
|
#2
| |||
| |||
|
|
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 |
#3
| |||
| |||
|
|
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? |
#4
| |||
| |||
|
|
"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. |
#5
| |||
| |||
|
|
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 |
#6
| |||
| |||
|
|
"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 |
#7
| |||
| |||
|
|
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 What happens if you do it manually? |
|
Who knows, maybe it's keeping it for an older system like A2003. Does it affect the system at all? Is it converted to A2010 format? |
#8
| |||
| |||
|
|
I am looking to automate because of the need to run the application using both A97 and A2010 depending on the workstation. So I need to automate converting from A97 to A2010 when changes are made. |
#9
| |||
| |||
|
|
"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 |
#10
| |||
| |||
|
|
On 9/3/10 12:49 PM, paii, Ron wrote: I am looking to automate because of the need to run the application using both A97 and A2010 depending on the workstation. So I need to automate converting from A97 to A2010 when changes are made. Wouldn't it be simpler to just hide the toolbars instead of wiping them out when you convert? IINM, by default, the toolbars goto into AddIns; just throw a custom XML that suppress the AddIns tab. Will that do it? |
![]() |
| Thread Tools | |
| Display Modes | |
| |