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
  #1  
Old   
paii, Ron
 
Posts: n/a

Default Replacing Toolbars with Ribbon - 09-02-2010 , 03:22 PM






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

Reply With Quote
  #2  
Old   
Salad
 
Posts: n/a

Default Re: Replacing Toolbars with Ribbon - 09-02-2010 , 07:14 PM






paii, Ron wrote:

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

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

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



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

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

Reply With Quote
  #4  
Old   
Salad
 
Posts: n/a

Default Re: Replacing Toolbars with Ribbon - 09-03-2010 , 10:24 AM



paii, Ron wrote:
Quote:
"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

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

Default Re: Replacing Toolbars with Ribbon - 09-03-2010 , 12:14 PM



"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

I tried your code, as you expected, it did not work. By the way, this is for
Access 2010.

Thanks for the help

Reply With Quote
  #6  
Old   
Salad
 
Posts: n/a

Default Re: Replacing Toolbars with Ribbon - 09-03-2010 , 01:32 PM



paii, Ron wrote:
Quote:
"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?

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

Default Re: Replacing Toolbars with Ribbon - 09-03-2010 , 02:49 PM



"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

What happens if you do it manually?
I can delete it manually, which will allow me to open the report without the
old toolbars imported into the MDB
Quote:
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?

I have converted the MDB from Access 97 to 2010 by both having Access
convert a copy, and opening a blank database and importing all the objects
from A97 mdb. In the current version, I opened a blanked database and
imported from a converted copy.

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.

Reply With Quote
  #8  
Old   
Banana
 
Posts: n/a

Default Re: Replacing Toolbars with Ribbon - 09-03-2010 , 02:53 PM



On 9/3/10 12:49 PM, paii, Ron wrote:
Quote:
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?

Reply With Quote
  #9  
Old   
Salad
 
Posts: n/a

Default Re: Replacing Toolbars with Ribbon - 09-03-2010 , 02:55 PM



paii, Ron wrote:

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

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

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



"Banana" <Banana (AT) Republic (DOT) com> wrote

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

Yes it would be simpler, and during my 1st tests I imported the toolbars.
But they are something that is not needed 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.