Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 724
  • Last Modified:

Access 2010 Autoexec problem

Hi EE

I am having an Autoexec problem I have the following function
Public Function HideRibbon()
    DoCmd.ShowToolbar "Ribbon", acToolbarNo
End Function

 The Autoexec Macro as follows
RunCode
HideRibbon()

If I run Autoexec it works fine but wont work when I open the Application.
Am I doing something wrong

chestera
0
chestera
Asked:
chestera
  • 13
  • 9
  • 2
  • +1
1 Solution
 
DatabaseMX (Joe Anderson - Microsoft MVP, Access and Data Platform)Commented:
The Ribbon does not load until an AutoExec macro has completed, as I discovered a while back.

mx
0
 
chesteraAuthor Commented:
DatabaseMax

So my function and Autoexec are correct what should I do

chestera
0
 
Dale FyeCommented:
no points please.

Call the function from within the Open or Load event of your splash form (the first one that opens in you application.
0
Prepare for your VMware VCP6-DCV exam.

Josh Coen and Jason Langer have prepared the latest edition of VCP study guide. Both authors have been working in the IT field for more than a decade, and both hold VMware certifications. This 163-page guide covers all 10 of the exam blueprint sections.

 
chesteraAuthor Commented:
fyed

I already tried that still not hiding the Ribbon. If I open the form within design mode it works
but not when I open the app itself

Alan
0
 
Oliver WastellCommented:
Hi Chestera,

I make ribbons disappear using the following method:

Create a table called 'USysRibbons' with the following two fields:
RibbonName (Text)
RibbonXml (Memo)

Now add to this table the following record:

RibbonName:
Standard

RibbonXml:
<customUI xmlns="http://schemas.microsoft.com/office/2006/01/customui">
  <ribbon startFromScratch="true">
  </ribbon>
</customUI>

You will then need to close down and reopen the database before going into
Access Options > Current Database

Under the heading 'Ribbon and Toolbar Options', you'll see 'Ribbon Name:' with a combo box.  In this combo box select 'Standard'.

When you open the database next it will load the standard ribbon which is empty, so in fact you will see no ribbon.

You can then define other ribbons as you need in the 'USysRibbons' table.  For example I have a print preview ribbon defined.  In the design view for a report on the 'Other' Property Sheet you can select your ribbon in the Ribbon Name property (all ribbons defined in the USysRibbons table will appear in the drop down box).
0
 
Oliver WastellCommented:
The Print Preview ribbon I use is defined in the USysRibbons table as follows:

RibbonName:
Print Preview

RibbonXML:
<customUI xmlns="http://schemas.microsoft.com/office/2006/01/customui">
  <ribbon startFromScratch="true">
<tabs>
<tab id="tabPrintPreview" label="Printer">
<group id="grpPrint" label="Printer"  visible="true">
 <button idMso="PrintDialogAccess" size="large" label="Print" imageMso="PrintDialogAccess"/>
</group>
<group id="grpZoom" label="Zoom" >
<splitButton idMso="PrintPreviewZoomMenu" size="large" visible="true"/>
<toggleButton idMso="ZoomFitToWindow" size="large"/>
<toggleButton idMso="ZoomOnePage" size="large"/>
<toggleButton idMso="PrintPreviewZoomTwoPages" size="large"/>
 </group>
<group id="grpExport" label="Export"  visible="true">
<button id="ExpExc" label="Export to Excel" imageMso="ExportExcel" onAction="mcrRibbon.ManualExportToExcel" size="large"/>
</group>
<group id="grpClosePreview" label="Close Report"  visible="true">
<button idMso="PrintPreviewClose" size="large" label="Close" imageMso="PrintPreviewClose"/>
</group>
</tab>
</tabs>
  </ribbon>
</customUI>
0
 
chesteraAuthor Commented:
odwastell

Many thanks for that bit of info I will now go and try it. My app is  written in Access 2003 If I open in 2010 and make an mde it works using the 2003 custom menu and removes the Ribbon toolbar. Not sure if using access 2003 under 2010 is a good idea but it works. I want to use 2010 and give 2003 away so need to know how to remove/Hide toolbar ribbon and design custom ribbons. Do you know any good books explaining creating custom menus in 2010

Alan
0
 
Oliver WastellCommented:
Hi Alan,

Wrox's: Microsoft Access 2010 Programmer's Reference by Teresa Hennig and others is an excellent book and has a chapter on customising the ribbon.  In fact it has lots of chapters on lots of different areas.  

I have a lot of clients running .mdb/.mde databases in Access 2007/2010 without issues.  However Access 2007+ has a lot going for it, especially when it comes to security.  Miles better.

Oliver
0
 
chesteraAuthor Commented:
odwastell

Followed your instructions creating USysRibbons

If I have the data in design mode I can select Standard from the combo box. If I have the Font end in design mode and select the combo box it's empty.

I will try and get a copy of Wrox's: Microsoft Access 2010 Programmer's Reference by Teresa Hennig

Alan
0
 
Oliver WastellCommented:
Sorry, I should have said, the USysRibbons table goes in the front-end as the ribbons are part of the user interface.  You can leave a copy of the USysRibbons table in the backend if you also want to hide the ribbons there (or create ribbons that are specific to the backend only), but don't link to it from the front end file.

The USysRibbons table is a system table which MS Access looks out for.  It is used by the file within which it is placed.
0
 
chesteraAuthor Commented:
odwastell

 I did put in the backend but for some reason I lost USysRibbbon it so re-cresated  and can now see standard from combo box in the font end put it's linked. I will remove to the front end. Putting in the front does make sense

Alan
0
 
Oliver WastellCommented:
In 'Navigation Options' (access by right clicking the top of the Navigation Pane) you'll need to check 'Show System Objects' otherwise tables starting USys will be hidden.
0
 
chesteraAuthor Commented:
odwastell

Yep got that. I transferred USysRibbon to the frontend. Entered Standard as Ribbon Name and in RibbonXml entered  <customUI xmlns=etc>
I ran the app but the ribbon still there. The drop down menu I am using is quite extensive to transfer to custom Ribbons looks like it could cost more man hours then developing the App it self.

Alan
0
 
Oliver WastellCommented:
I'm happy to take a look at your database if you don't mind sharing, either upload here or email the zipped copy to [email removed by SouthMod]
(I'm just leaving the office now so it won't be until sometime tomorrow)

One last thought before I go for now, if you convert your file to the Access 2007 format and run it, does the ribbon disappear?
0
 
DatabaseMX (Joe Anderson - Microsoft MVP, Access and Data Platform)Commented:
" either upload here or email the zipped copy to [email removed]"
Actually, EE rules do not allow emailing privately. You must upload to EE.

mx
0
 
chesteraAuthor Commented:
odwastell

It's a very large Database with sensitive data. I will fire up 2007 and see how it goes.
I have been playing with my own version of a ribbon menu. On a splash form I have a few labels that I have customised to emulate Buttons the beauty of this is you can colour or put images on the lable to suit what it represents. Clicking a label opens a form or show more labels as sub menus very similar to MOYB. It also shows my original 2003 dropdown menu for those users that prefer that type of menu.

Alan
0
 
chesteraAuthor Commented:
odwastell

Fired up 2007
Creating the USysRibbons table does the complete opposite to 2010.
It removes the Ribbon toolbar completely not leaving space to add custome ribbons and also my ADD-In 2003 menu. Bottom line in 2007 no menus just the splash screen

Alan
0
 
chesteraAuthor Commented:
DatabaseMX

I wont be emailing a copy of my database it's very large with some sensitive stuff. I normally use access 2003 build my Databases with custom dropdown menus then use 2010 and make an mde. It's the current user would like a Ribbon type of menu and what I have learned in the last few days it's seems quite complex.

I have tried the "Docmd.ShowtoolBar "Ribbon", acToolBarNo" placed in a function using Call HideRibbon and also tried Autoexec macro

If I place "Docmd.ShowtoolBar "Ribbon", acToolBarNo in the open or load event of my splash form and run in design mode it works same with Autoexec Marcro run within design mode it works

running as mde accde it don't work

Appreciate your help

Alan
0
 
chesteraAuthor Commented:
odwastell

Hi Oliver

I think we have gone as far as we can I have received a wealth of info from you to get me started. I downloaded a database called DatabaseDemonstration which has a very good example of how to create custom Ribbon and when run it works. Its the same methode you gave me and which I have added to my database so it should work I must have somthing not quite right. I ordered   that book by Teresa Henning. I really appreciate all you have done and thank you for your time

Alan
0
 
chesteraAuthor Commented:
DatabaseMX

Hi MX

Thank you for your input. Oliver has given me all I need to know to get me started so will give him all the points

Alan
0
 
Oliver WastellCommented:
Hi Alan,

No trouble at all.  Good luck with the ribbons.

Oliver
0
 
Oliver WastellCommented:
Hi Alan,
I hope that you are well.  If you need any help on assigning the points, please let me know.
Many thanks,
Oliver
0
 
chesteraAuthor Commented:
Oliver Wastell

Hi Oliver

I thought I closed this question and gave you the points but keep getting emails from EE.
If I haven't closed I Apologise .

Alan
0
 
chesteraAuthor Commented:
Oliver Wastell

Sorry for the delay thought I had awarded the points

Alan
0
 
Oliver WastellCommented:
No problem, thanks for the points and the grading.

Oliver
0

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

  • 13
  • 9
  • 2
  • +1
Tackle projects and never again get stuck behind a technical roadblock.
Join Now