Visibility property in access 2013

bnolte

New member
Local time
Today, 14:40
Joined
May 13, 2013
Messages
4
Hello,
I am creating a custom ribbon and am creating buttons with separators between them. While I am able to set the visibility as needed I want to set the visibility of the separator based on the buttons visibility.

As such how do you reference a specific control's visibility on a custom ribbon. Button1.visible = True does not work but instead returns a runtime error 424 object required. Setting to ribbonname.Button1.visible = true returns a runtime error 438, object doesn't support this property or method.

Does anyone know how to reference a control/button's properties?
 
Well, far as I know has no control separators with attributes getVisible, so we can change. In tests I did on the 2013 version was also not possible to change the separators.

I suggest disabling (getEnabled) instead of hiding the buttons.
 
The problem isn't with hiding the buttons as that works fine with the getVisible function. What I am trying to do is hide the separator if the button next to if is not visible (the control.id is listed in a case statement)
 
As I've said, there's no way to hide the separators. Therefore the proposal to disable the buttons to keep the layout..
 
Are you thinking the group separators? I am manually adding vertical separators between the buttons via the <separator id = "Separator1" getVisible = "SeparatorVisible" /> line in the xml.


So far this is the only work around I can come up with but trying to find a way to do this that would reduce the overall code.While I can look at the buttons properties with the Button1 = visible the evaluation of if (button1 = visible) = true always returns true because at the onLoad function the button has not yet been hidden. So to allow the separator to be hidden I have to create a public variable and when the visibility of the button is set also set the variable to the same result. This way when the check is made for the separator if will act off the variable.

As I said not the most elegant way to do this but its the only thing I came up with so far.
 
I apologize. The getVisible works for saparator in Access 2013.

Here's an example. I think just use the same criteria for the corresponding button.

Code:
Public Sub fncGetVisible(control As IRibbonControl, ByRef visible)
Select Case control.id
    Case "sp100"
        visible = (booStatus = False) ' use the same criteria as the corresponding button (btn_1101).
    Case "btn_1101"
        visible = (booStatus = False)
    Case Else
        visible = True
End Select
End Sub

When running the example, click the "Open frmMain" of ribbon.
 

Attachments

Last edited:

Users who are viewing this thread

Back
Top Bottom