Results 1 to 2 of 2
  1. #1
    dtc is offline Novice
    Windows 7 32bit Access 2007
    Join Date
    Jul 2012
    Posts
    1

    Post Invalidating buttons on ribbons access 2007

    Hi, I have access application with two forms. On main form, which is also starup form, I have custom ribbon in which I would like to disable several buttons based on if form has linked tables or not. I have created a callback function and I am using the get enabled in the xml code. When the db first opens and form opens, the buttons are disabled. However when I navigate away from the form and back to the form, the buttons become enabled again, and I am unable to toggle them back off. I have tried calling objribbon.invalidate on several events within the startup form (gotfocus, current, onload) and none of these events seem to invalidate the controls.



    Below variables and functions in use:
    returnedVal as boolean
    VisibleTrueFalse as boolean

    Public Sub ribbonLoaded(ByVal Ribbon as IRibbonUI)
    Set gobjRibbon = Ribbon
    end sub


    Public Function Inval(control as IRibbonControl, ByRef returnedVal)
    returnedVal = VisibleTrueFalse
    end function

    XML
    onLoad="ribbonLoaded"
    statement at end of button definition: getEnabled="Inval"



    When the db first opens, the botton is disabled. However when I move to a different form, which has its own custom ribbon, and back to the main form, the button becomes enabled, and I am unable to disable again.

    Have tried calling the objribbon.invalidate on several of the events on the form. The form is not bound to any records, it simply displays a list of items to navigate to other bound forms.

    Does anyone have experience with this issue, your help would be greatly appreciated.

    thanks,

  2. #2
    amrut is offline Expert
    Windows 7 64bit Access 2010 32bit
    Join Date
    Jun 2012
    Location
    India
    Posts
    616
    Have you "disabled" the controls before the "objribbon.invalidate" line ? For ex. if a button has to be disabled, a variable say btnEnable as boolean should be declared for each control you intend to disable/enable. Then you can disable it by -
    btnEnabled=False
    objribbon.invalidate

    and to enable it by
    btnEnabled=True
    objribbon.invalidate
    Have a look at this site -http://www.accessribbon.de/en/?Welcome dedicated to ribbons!

Please reply to this thread with any new information or opinions.

Similar Threads

  1. How to LOAD access form without ribbons and toolbar?
    By taimysho0 in forum Programming
    Replies: 5
    Last Post: 07-05-2012, 07:19 AM
  2. Replies: 3
    Last Post: 02-20-2012, 09:39 AM
  3. Invalidating dropdown control on Access 2007 ribbon
    By kenwarthen in forum Programming
    Replies: 0
    Last Post: 08-16-2010, 09:29 AM
  4. Access 2007 Command Buttons
    By fgerald in forum Access
    Replies: 2
    Last Post: 03-05-2010, 07:09 PM
  5. Access 2007 - Hide Ribbons
    By FPeteE in forum Access
    Replies: 1
    Last Post: 11-17-2009, 03:55 PM

Tags for this Thread

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