dbTalk Databases Forums  

Replacing Toolbars with Ribbon

comp.databases.ms-access comp.databases.ms-access


Discuss Replacing Toolbars with Ribbon in the comp.databases.ms-access forum.



Reply
 
Thread Tools Display Modes
  #11  
Old   
paii, Ron
 
Posts: n/a

Default Re: Replacing Toolbars with Ribbon - 09-07-2010 , 07:08 AM






"Salad" <salad (AT) oilandvinegar (DOT) com> wrote

Quote:
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?
Yes they can be deleted manually.

Reply With Quote
  #12  
Old   
paii, Ron
 
Posts: n/a

Default Re: Replacing Toolbars with Ribbon - 09-07-2010 , 07:55 AM






"Salad" <salad (AT) oilandvinegar (DOT) com> wrote

Quote:
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

Salad's code works in A97 in but not in A2010.

Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.