Ribbons - FAQ

I’ve put together some of the main doubts that people send to the support that I offer for the ones that buy MontaRibbons.

1) Is it possible to use Ribbons at MDB or ADP projects?

Yes. But you need to be running it at Access 2007 or Access 2010

2) Can I use macros to activate the buttons of a ribbon?

Yes! Create a global macro and inside of this the command sub macros.

Example of a button:

<button id = "btCustomers"
imageMso = "CreateTableTemplatesGallery"
label = "Customers"
onAction = "mcr_ribbon.mOpenFormCustomers"/>

mcr_ribbon > Global macro
mOpenFormCustomers > sub macro with the action ‘’Open form’’

3) Avelino, the ribbon I’ve made for my BD was working perfectly. But I decided to split the BD (back-end and front-end) and the ribbon stopped working. I can’t understand why. Can you help me?

The Access assistant, that maked the BD split, loads the table UsysRibbons for the back-end. Get the UsysRibbons table back to the front-end that it will work.

4) I have lots of forms, reports and queries that I access using the Ribbons and my SELECT CASE, in the function fncOnAction, is getting huge. Is’nt there another way to simplify this programming?

Yes,there is. We can use, in the attribute onAction of the buttons, a function that changes parameters.

Copy the function below to a random global module:

Public Function fncOpenObject(nameObject As String, typeObject As Byte)
Select Case typeObject
   Case 1 'form
      Docmd.OpenForm nameObject
   Case 2 'report
      Docmd.OpenReport nameObject , acViewPreview 
   Case 3 'query
      Docmd.OpenQuery nameObject
End Select
End Function

Now, use the function directly in the XML, like the example below:

<button id = "btBackup"
imageMso = "FileBackUpSqlDatabase"
label = "Backup"
onAction = "=fncOpenObject('frmBackup',1)" />

5) Avelino, I was trying to make a Ribbon to use with dynamic graphics. Using MontaRibbons, I’ve found a button with idMso ‘FieldList’ that shows all the fields that can be used with dynamic graphics. At first, when i started it on the mode .accdb it worked perfectly, but when I used it on the mode .accdr, it just simply disappeard from the menu. I believe that Access considers it an design mode application and that why it isnt working at runtime. I Would like to know if its possible to make this button work at the .accdr mode.

Force the visualization with the attribute visible;

<toggleButton idMso="FieldList" label="Lista" visible="true"/>

6) Avelino, I cannot find the table UsysRibbons.

Its a system table. To be able to see them, you must do as follows:

Office button > Access Options > Current Database > Click on the button ‘’Navigation Options’’ > check "Show System Objects”

7) How can I keep the focus on a cosen Tab of the ribbon?

At the Access 2010 they solved this. Look:

objRibbon.ActivateTab "YourTabName"

At Access 2007, you will have to use the SendKeys:

1) Add a keytip to each one of the tabs:

<tab id="MainTab" label="Main" keytip="H1">

2) Code:

Public Function fncSetFocusTab()
Dim ws As Object
#If VBA7 Then
    'Access 2010
    objRibbon.ActivateTab "TabName"
#Else
    'Access 2007
    Set ws = CreateObject("WScript.shell")
    ws.SendKeys "%H1%"
    Set ws = Nothing
#End If
End Function

Don’t use the SendKeys of thr Access because it happens the famous problem that desable the numeric keypad.

8) Avelino, I’ve bought your selection at the website and installed the app UsandoAccess, and there I’ve realized that you were able to hide all the superior ribbon of the access, including the Office’s Button. How can this be done

Check this article to see how this can be done.

9) I was making my Ribbon at MontaRibbons and its not showing anymore. What have I done wrong? Im using Access 2010.

Enable the error detection that you will find the cause.

File button > Options > Client Settings > Check “Show add-in user interface errors”

10) How can I minimize the starting Ribbon at the starting of my application?

At Access 2007 there isn’t a command to do so. The combination of CTRL + F1 will maximize or minimize a ribbon.

Use the function below at your opening form or in the macro AutoExec :

Public Function fncMinimizeRibbon() As Boolean
Dim ws As Object
Set ws = CreateObject("WScript.shell")
If Application.CommandBars("ribbon").height > 140 Then
   ws.SendKeys "^{f1}"
End If
Set ws = Nothing
End Function

Use the SendKey of the Windows scrpit because the one from Access turns off the NumLock key.

At Access 2010 there is a command too, like I show below. I haven’t tested it yet. The function above must work at Access 2010 too.

CommandBars.ExecuteMso "MinimizeRibbon"

11) How can I disable the message: ‘’press F1 for more help’’ at the help panel?

The bottom part of the help panel, that tells you to press f1, can’t be disabled. But you can disable the help panel, following this steps:

Office Button > Access Options > General > Open the Combo “ScreenTip style” and select “Don't show ScreenTips’’

12) I’m developing an app, using MontaRibbons and Maestro, but i’ve got a problem: I created the main ribbon and another one that is added by a form. It happens that when I call this form, this opens with the ribbon, but it suddenly disappears and get back to the main ribbon. I’ve checked the references and its enabled.

The ribbons do not work at forms or reports that are at POP-UP mode. Change this POP-UP property to no.

13) "The Microsoft Access cannot run the macro or the back call function ‘fncOnAction’”, and I alread copied the modules MOD_RIBBONS to my system and the function is inside of this module. I have also put the reference of the Object Library 12.0

I ask you to check again, with all your attention, the reference! Select the reference MICROSOFT OFFICE 12.0 OBJECT LIBRARY. Do not confuse it with the reference MICROSOFT ACCESS 12.0 OBJECT LIBRARY.

14) At my system, version 2003, I had shortcut icons to the most used forms. Is there an way to make it at Access 2007, so these shortcuts are always visible?

At Access 2007 and 2010 there is what we call "quick access toolbar". It stays at the left superior part of the Access ribbon, and can also be placed at the lower part, if you wish. The customization of this Bar, with its buttons, is made by the XML of your main Ribbon.

Example of a configuration of a button at the “quick access toolbar”, also known as qat

...
<ribbon startFromScratch="true">

<!-- ***TAG QAT***-->

<qat><documentControls>

<button id = "btCustomers" imageMso = "CreateTableTemplatesGallery" onAction = "fncOnAction"/>

</documentControls></qat>
...

15) When I start my app, when the login screen shows up, the ribbon is loaded. In fact, it should be loaded when i make the login. The login screen is the same as Maestro’s. So, how can I keep the Ribbon unable until I Log in, like it’s done at Maestro?

The main tab of your ribbon must have the attribute getVisible. Example:

<!-- *** MAIN TAB ***-->

<tab id = "MainTab" label = "Main" getVisible="fncGetVisible">

To control the ribbon loading, at the starting of Maestro, its used a variable of name nlogoff, that is in the module mod_login

Public nlogoff As Boolean

At the beginning of the function fncGetVisible, this variable is used, ending the function and preventing any changes at the Gets value. The standard value is false to the getEnabled. So, the main tab is started with its getVisible = false, hiding the ribbon.

Public Sub fncGetVisible(control As IRibbonControl, ByRef visible)
On Error GoTo trataerro
If nlogoff = False Then Exit Sub
Select Case control.id
...
...

This variable is also changed at the form frmLogin , just after the user authentication.

...
...
    '----------------------------------------
    'reconfig ribbon rbPrincipal at logoff
    '----------------------------------------
    If nlogoff = False Then nlogoff = True
       
    '------------------------------------------------------------------
    'revalidates all the controls of the ribbons that are using the gets
    '------------------------------------------------------------------
    objRibbon.Invalidate
...
...

16) At access 2003, I used the following command to compact and repair the database:

CommandBars("Menu Bar"). _
Controls("Tools"). _
Controls("Utilities of the database "). _
Controls("Compact and repair database”..."). _
accDoDefaultAction

But at Access 2007, this command does not work. Is there any way to fix it, to call the Office Menu command?

Add button:

<button idMso = "FileCompactAndRepairDatabase" label=”Compact” visible=”true”/>

17) Inside the Office there is a button “Access Options” that’s at the sctructure of the XML

<command idMso="ApplicationOptionsDialog" enabled=”false"/>

How can I enable this button by the user Id?

Click at the button HELP CONTROLS of the MontaRibbons.  Select the control ‘’commands” at the list. This way you will get the code that guides this button, the way you wish.

18) I’m making a control system to my company. I created an special ribbon with 4 tabs: Commercial, Stock, Financial e Admin.

How can I do it, so when I click at the Tab, the corresponding form opens?

The tabs do not have a command to run a task.

My suggestion is that you create a ribbon to each form. Also create a Main ribbon, that has all the call buttons of the forms. When you load the chosen form, by the main ribbon, the ribbon linked with the form will be loaded.

As an alternative, see the example I developed for an American, to meet the same need as you. In this case, you will need a higher programming knowledge.

19) How can I hide the btregistry button, like the line below, when the user register the program?

<button id = "btRegistry" imageMso = "HappyFace" label = "Register the system" size="large" getVisible="fncGetVisible" onAction = "fncOnAction"/>

 

Do you keep the information that you have been registered in a table? If so, use the function Dlookup() to get this information from the table and apply as a condition to hide the button.

Example of the code used in the function fncGetVisible():

Public Sub fncGetVisible(control As IRibbonControl, ByRef visible)
...
Case “btRegistry”
   If Dlookup(“Registered”,”tblRegistry”)= -1 then
      visible = false
   Else
      visible = true
   End if
...
...

Remember that to start the gets, you must use the Invalidate. If you want to change just the registry button, start the getVisible with the InvalidateControl. Example:

objRibbon.invalidateControl ("btRegistry")

Be careful with the use of the InvalidateControl, that is case sensitive, that is, btRegistry is different from BtRegistry.

20) I created a ribbon at MontaRibbons and exported it to Maestro, version 2. I’ve realized all the steps indicated at MontaRibbons, but when i trigger the form it does not bring the ribbon I created. I already looked the table tblRibbons and the new ribbon is there, but it does not show when i trigger the form.

In this case Maestro 1 is way different from Maestro 2. The objective was to show how to make the app use ribbons with different structures, according to the Access version. You have two paths:

1st – Choose on the MontaRibbons, export to the table UsysRibbons. The table UsysRibbons will be created at Maestro and you will be able to use it more simply.

Detail: you can work with the two tables (tblRibbons e USysRibbons) in your app, with no problem; you just can’t use the same ribbon name.

2nd – Exporting to the table tblRibbons, you must open it, identify your ribbon and check the field ribbon so Maestro can identify that it’s a ribbon.

21) Is there an way to modify the Office button image?

Here follows an example file, with the codes for this. Never used nor tried, so I dont know the efficiency of the code.

22) Avelino, as I clean the backstage Access 2013 ? I'm using the 2010 version and configuration presents several errors.

The new layout backstage Access 2013 is this:

<!-- *** BACKSTAGE ***-->

<backstage>
  <tab idMso ="TabInfo" visible="false"/>
  <tab idMso ="TabOfficeStart" visible="false"/>
  <tab idMso ="TabRecent" visible="false"/>
  <button idMso="FileSave" visible="false"/>
  <tab idMso ="TabSave" visible="false"/> 
  <tab idMso ="TabPrint" visible="false"/>
  <button idMso="FileCloseDatabase" visible="false"/>
  <tab idMso ="TabHelp" visible="false"/>
  <button idMso="ApplicationOptionsDialog" visible="false"/>
</backstage>

 


 

Links

Subjects

Article and Video 1

 
Brief presentation of MontaRibbons
Structural concept of the XML used
How to disable all the upper ribbon of the Access
Using images from the Office’s gallery
Using internal controls of the Office
Customizing the quick toolbar
Customizing the Office Button
How to create a custom ribbon
 

Article and Video 2

 
Setting the control splitButton
Setting the control menu
Differences between the controls splitButton and menu
Exporting the ribbons for your applications
How to give functionality to the buttons on the ribbon
 

Article and Vídeo 3

 
Changing the controls at runtime, using the attributes gets
How to configure the ribbon for the language exchange
How to hide / disable the buttons on the ribbon, depending on the User logged
 


Article and Video 4

Using external images (GIF, JPEG e PNG)

Article and Video 5

 

Images (GIF, JPEG, PNG e ICO) taken from the attachment type field 
 

Article 7

Combobox and Dropdown, in practice


MontaRibbons

All the details about how to purchase

 

 


10 comentários

May   7/21/2012 8:05:28 PM

How do I create a quick access ribbon or toolbar in ms access 2007? I need to put the run time version on someones PC who is going to use a database I have made for them and I see when I try this out on a pc using runtime there is no quick access ribbon or toolbar available - I am not a developer or programmer so don't have much knowledge in setting up this sort of thing, but can do basic things in access. Any advise would be appreciated.

Avelino Sampaio   7/22/2012 8:26:00 AM

Hi May

The first two videos classes, offered here on the site, will give you the knowledge needed to assemble your ribbons persanilzadas.

You do not need advanced knowledge of programming.

The application MontaRibbons, export to your application, all necessary codes. It will do you make small adjustments.

You will have my full assistance.

Any other questions do not hesitate to ask me.

Márcio Melo -RJ   4/17/2013 7:51:44 PM

Olá, Maio eu também passei pela ajuda do mestre Avelino, realmente assistindo as vídeo aulas e com o uso do Maestro com pontapé inicial as coisas começaram a ser encaixar, o link tem uma ajuda online do programinha que fiz com ajuda do monta Ribbons http://sic.iniciantejoomla.com/ no menu de introdução tem uma foto de como ficou o menu, depois que fizer o seu primeiro menu os outros serão moleza. Depois vi ver que tudo se encaixa - Open , Maestro, Monta Ribbons e muita outras dicas aqui do site...

Sou mais Brasil!

Abs...

Jim Maatman   7/17/2013 12:04:29 PM

I have just started using my copy of Monta Ribbons and am not able to use the IDMso table as shown in the videos. When clicking the down arrow in the filed headers (Control Name, Control Type, Tab Set Name, etc) I get an error: "Syntax error (missing operator) in query expression 'Control Name'."

jdmaatman@gmail.com

eduardo   2/3/2014 12:53:52 AM

He utilizado el ejemplo para ocultar los comandos de la vista backstage de acces 2013 satisfactoriamente, pero tengo un problema, sigue apareciendo una opcion de complementos que me permite enviar por bluetooth la aplicacion, quiero saber como deshabilitar esta opcion.
Gracias por su colaboracion

Brian   4/24/2014 2:27:22 PM

How do you get the UsysRibbons table back to the front-end?

Avelino Sampaio   4/24/2014 4:29:12 PM

Brian,

set Access to view the system tables. (File> options> current database> Navigation options)
Use the right mouse button to cut (back-end) and paste (front-end) table

Alan   9/1/2014 2:07:55 PM

Why can I not see the image gallery selections when I click on "Images 2010/2013"?

Emanuele   10/8/2015 6:57:15 AM

thank you very much! you answers are very useful!

HANI   7/9/2016 9:33:04 PM

I'm trying to create ribbon xml in access 2010
but the ribbon not load in toolbar
only display in option...
i nead help

thank



Send your comment: