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,