Page 1 of 2 12 LastLast
Results 1 to 15 of 28
  1. #1
    FER is offline Novice
    Windows 10 Access 2007
    Join Date
    Apr 2025
    Posts
    19

    Change Toolbar Access 2003 to Access 2007

    Hello,


    I still use Access 2007 from Access 2023 on Windows 10,
    I have a toolbar attached to a tab that automatically opens in Add-Ins,


    I would simply like to change the instruction of an existing button (from open Tab X to Open Tab Y)


    where can I make this change?


    I tried to use Ribbons but Access 2007 does not see them, I would prefer to simply change the existing one.

  2. #2
    June7's Avatar
    June7 is offline VIP
    Windows 11 Access 2021
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,771
    You have a db created with Access 2007 and use it with Access 2023?

    You mean you have a customized ribbon? We need your code. Could just provide db for analysis. Follow instructions at bottom of my post.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  3. #3
    FER is offline Novice
    Windows 10 Access 2007
    Join Date
    Apr 2025
    Posts
    19
    Quote Originally Posted by June7 View Post
    You have a db created with Access 2007 and use it with Access 2023?
    No, the Db was created with Access 2003 then acquired in Access 2007, which is what I still use, the toolbar was created by Access 2003 and now I see it in Access 2007 in add-ins.
    I have done millions of tests but there is no access to modify it, I highlight that I have not created the code in modules.




    I also tried to create a test Ribbon, but that does not work either:
    table; USysRibbons
    ID 1
    Ribbon Name: TEST
    RibbonXml:
    <customUI xmlns="http://schemas.microsoft.com
    /office/2006/01/customui">
    <ribbon startFromScratch="false">
    <tabs>
    <tab idMso="TabCreate" visible="false" />
    <tab id="dbCustomTab" label="A Custom Tab" visible="true">
    <group id="dbCustomGroup" label="A Custom Group">
    <control idMso="Paste" label="Built-in Paste" enabled="true"/>
    </group>
    </tab>
    </tabs>
    </ribbon>
    </customUI>


    The bar is not even visible in Options > Ribbon Options


    What the hell, should I throw in the towel ?

  4. #4
    June7's Avatar
    June7 is offline VIP
    Windows 11 Access 2021
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,771
    No idea without being able to debug for myself.

    Did you try saving the db as 2007 accdb file?
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  5. #5
    davegri's Avatar
    davegri is offline Excess Access
    Windows 11 Access 2021
    Join Date
    May 2012
    Location
    Denver
    Posts
    3,741
    See if this is helpful (access - excel, same-o, same-o). In addition, you can also explore creating Add-Ins with Access macros. Google it.

    excel - Adding macro to Add-ins tab Custom Toolbars? - Stack Overflow

  6. #6
    FER is offline Novice
    Windows 10 Access 2007
    Join Date
    Apr 2025
    Posts
    19
    Sorry for the delay,
    thanks for the suggestions.
    I solved the RIBBONS problem, it works,
    but now I have a problem, I would like to change the following instruction

    <control idMso="Paste" label="Built-in Paste" enabled="true"/>

    with "open.form "MyForm"

    what is the idMso command to open a form?


    or do I have to create a separate code (I don't have the main form yet) ?

  7. #7
    June7's Avatar
    June7 is offline VIP
    Windows 11 Access 2021
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,771
    It's been a while since I built custom ribbon. I think what you want requires a "call back" procedure and that involves VBA. I have a form that opens by default when the custom ribbon loads.
    Ribbon code:
    Code:
    <customUI xmlns="http://schemas.microsoft.com/office/2006/01/customui" onLoad="OnRibbonLoad" >
      <commands>
        <command idMso="Help" enabled="false"/>
      </commands>
      <ribbon startFromScratch="true">
        <officeMenu>
          <button idMso="FileOpenDatabase" visible="false"/>
          <button idMso="FileNewDatabase" visible="false"/>
          <button idMso="FileCloseDatabase" visible="false"/>
        </officeMenu>
        <qat>
          <documentControls>
            <button idMso="DataRefreshAll"/>
          </documentControls>
        </qat>
      </ribbon>
    </customUI>
    VBA procedure in general module:
    Code:
    Sub OnRibbonLoad(ribbon As IRibbonUI)
        ' procedure called by custom ribbon code in QATRibbon record of USysRibbons table
        ' QATRibbon is set as the default ribbon when database opens
        DoCmd.OpenForm "Login"
    End Sub
    If you want a ribbon button to open a form, probably find example at https://www.avenius.de/en/
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  8. #8
    davegri's Avatar
    davegri is offline Excess Access
    Windows 11 Access 2021
    Join Date
    May 2012
    Location
    Denver
    Posts
    3,741
    To expand on June7's post, here's a ribbon definition that I was working with about a year ago that opens a form via a callback. It creates a new tab called "EDIT" and has 2 buttons for 2 forms.

    Code:
    <?xml version="1.0" encoding="utf-8"?>
    <!-- Video 4 http://accessjitsu.com/custom-ribbon/  -->   
    <customUI xmlns="http://schemas.microsoft.com/office/2006/01/customui" onLoad="OnRibbonLoad">
      <ribbon startFromScratch="false">
        <tabs>
          <tab idMso="TabAddIns" visible="false"/>
          <tab id="Edit" label="Edit">
            <group id="OpenForm" label="Open Form">
               <button id="MainMenu" label="Main Menu" imageMso="BlogHomePage"
                  tag="frmMainMenuExample" onAction="ribOpenForm" getEnabled="ControlEnabled"
                  size="large" supertip="Open the Main Menu"/>
               <button id="FormText" label="Formatted Text" imageMso="FormatTextMore"
                  tag="frmFormattedTextExample" onAction="ribOpenForm" getEnabled="ControlEnabled"
                  size="large" supertip="Open the form for whatever"/>
            </group>
          </tab>
    
    
        </tabs>
      </ribbon>
    </customUI>
    The callback

    Code:
    '---------------------------------------------------------------------------------------
    ' Method : ribOpenForm, callback
    ' Author : davegri
    ' Date   : 03/01/24
    ' Purpose: Open the form that is specified in a ribbon control's tag property.
    ' Note that in the ribbon XML, the argument ('control' below) for the onAction
    ' is not explicitly named, it is simply implied by XML context to be the control's tag
    '---------------------------------------------------------------------------------------
    Public Sub ribOpenForm(Control As IRibbonControl)
        DoCmd.OpenForm (Control.Tag)
    End Sub

  9. #9
    FER is offline Novice
    Windows 10 Access 2007
    Join Date
    Apr 2025
    Posts
    19
    Thank you for the suggestions,
    but I understand that without the VBA code callback it is not possible to launch the "open form" command or macro from Ribbons XML.


    The problem is that I do not have the Standard main module in the command navigation pane, I did not create it because in the past having coded the entire DB in VBA code in the modules blocked any variation of queries, masks, etc.
    Since the DB in question is subject to various changes during the year I am afraid to create the main VBA module to avoid usage blocks, as there is a huge amount of data.


    Or is it possible to create a small VBA code only and exclusively for the ribbon in question ?

  10. #10
    June7's Avatar
    June7 is offline VIP
    Windows 11 Access 2021
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,771
    Sorry, I don't understand "VBA code in the modules blocked any variation of queries, masks, etc."
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  11. #11
    davegri's Avatar
    davegri is offline Excess Access
    Windows 11 Access 2021
    Join Date
    May 2012
    Location
    Denver
    Posts
    3,741
    Or is it possible to create a small VBA code only and exclusively for the ribbon in question ?
    Yes. You can create a new module named, for example, modRibbon, and put the code there.

  12. #12
    FER is offline Novice
    Windows 10 Access 2007
    Join Date
    Apr 2025
    Posts
    19
    Quote Originally Posted by davegri View Post
    Yes. You can create a new module named, for example, modRibbon, and put the code there.
    Great,
    so I can start directly from Module1 with "option compare database"?

    Now I need to figure out how to start the VBA reference,
    with Sub by any chance?

  13. #13
    davegri's Avatar
    davegri is offline Excess Access
    Windows 11 Access 2021
    Join Date
    May 2012
    Location
    Denver
    Posts
    3,741
    Quote Originally Posted by FER View Post
    Great,
    so I can start directly from Module1 with "option compare database"?

    Yes.

    Now I need to figure out how to start the VBA reference,
    with Sub by any chance?
    Examine the example in post 8
    The onaction="ribOpenForm" names the sub you want to execute in Module 1.

  14. #14
    FER is offline Novice
    Windows 10 Access 2007
    Join Date
    Apr 2025
    Posts
    19
    Quote Originally Posted by davegri View Post
    Examine the example in post 8
    The onaction="ribOpenForm" names the sub you want to execute in Module 1.
    Fantastic,


    now it's clear


    one last thing, the image shown in the Ribbon << imageMso="BlogHomePage" >> already exists loaded in Access or must it be stored separately ?
    Are there system images preloaded in Access ?

  15. #15
    davegri's Avatar
    davegri is offline Excess Access
    Windows 11 Access 2021
    Join Date
    May 2012
    Location
    Denver
    Posts
    3,741
    Quote Originally Posted by FER View Post
    Fantastic,


    now it's clear


    one last thing, the image shown in the Ribbon << imageMso="BlogHomePage" >> already exists loaded in Access or must it be stored separately ?
    Are there system images preloaded in Access ?
    Images are built into Office. You can see them here in the backstage of this Word document.
    Office2010IconsGallery.zip

Page 1 of 2 12 LastLast
Please reply to this thread with any new information or opinions.

Similar Threads

  1. Find Report.Toolbar items to change
    By Ron@Maastricht in forum Access
    Replies: 2
    Last Post: 05-02-2023, 03:17 PM
  2. Replies: 6
    Last Post: 11-01-2019, 05:05 AM
  3. Replies: 2
    Last Post: 06-18-2011, 09:55 AM
  4. Replies: 1
    Last Post: 06-20-2010, 05:04 AM
  5. Access 2007 menu bar, toolbar...
    By truthseeker170 in forum Security
    Replies: 1
    Last Post: 07-15-2009, 01:45 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums