Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
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
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
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
Stephen,
Thank you! Adding the .SetContent and .GetContent calls in worked!
Regards,
Jeff