Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Want to see what's currently in public preview? We've pulled it all together in one place. Check it out here
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Hidden list box toggle

Hello,

I have a list box that will be locked and hidden.  I also have a button that I want to use to toggle the visibility of the list box.  I created a variable called "isVis" which is set to 1. 

I have the action on the button running a macro that has:

sub changeVis
     if isVis = 1 Then
          isVis = 2
     else
          isVis = 1
     end if
end sub

If anyone can tell me what is wrong with this that would be greatly appreciated!

Thank you,

Jeff

Labels (1)
1 Solution

Accepted Solutions
Not applicable
Author

The code below is similar to what you want and should lead you in the right direction. You can also show or hide a list box using the "Show - Conditional" on the Layout tab.

hth

Stephen

Sub ShowHide

set v = ActiveDocument.Variables("vReport")

if(v.GetContent.String)= "Crops" then

set v = ActiveDocument.Variables("vShowHide")

           v.SetContent  "2", True

else

set v = ActiveDocument.Variables("vShowHide")

           v.SetContent  "1", True

end if

end sub

View solution in original post

2 Replies
Not applicable
Author

The code below is similar to what you want and should lead you in the right direction. You can also show or hide a list box using the "Show - Conditional" on the Layout tab.

hth

Stephen

Sub ShowHide

set v = ActiveDocument.Variables("vReport")

if(v.GetContent.String)= "Crops" then

set v = ActiveDocument.Variables("vShowHide")

           v.SetContent  "2", True

else

set v = ActiveDocument.Variables("vShowHide")

           v.SetContent  "1", True

end if

end sub

Not applicable
Author

Stephen,

Thank you!  Adding the .SetContent and .GetContent  calls in worked! 

Regards,

Jeff