Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Dear Qlikview user
I have a 3 buttons and each button has an action on it which runs the same macro.
The buttons control the tabs on a container I.e. if Button 1 gets clicked, then tab 1 shows in the container. This is achieved by the following macro:
Sub ActivateTab(I)
for j = 1 to 2
Set Obj=ActiveDocument.GetSheetObject("Container_" & j)
Set ObjProp=Obj.GetProperties
ObjProp.SingleObjectActiveIndex=I
Obj.SetProperties ObjProp
next
end Sub
Sub ActivateTab1()
ActivateTab(1)
end Sub
Sub ActivateTab2()
ActivateTab(2)
end Sub
Sub ActivateTab3()
ActivateTab(3)
However in addition to all this, I have a multibox which I only want to appear if the user clicks on Button 1 (Which activates tab 1 of the container), but am unsure how to put a conditional show based on the selection of a macro on a multibox
Can anyone help on how I put a conditional show on something based on a macro
Kind Regards
Hello Helen,
you can set a variable in your macro. Then you can add a conditional show if(vShow=1,1,0) to your multibox
Sub ActivateTab(I)
for j = 1 to 2
Set Obj=ActiveDocument.GetSheetObject("Container_" & j)
Set ObjProp=Obj.GetProperties
ObjProp.SingleObjectActiveIndex=I
Obj.SetProperties ObjProp
next
end Sub
Sub ActivateTab1()
set vShow = ActiveDocument.Variables("vShow")
vShow.SetContent 1 , true
ActivateTab(1)
end Sub
Sub ActivateTab2()
set vShow = ActiveDocument.Variables("vShow")
vShow.SetContent 0 , true
ActivateTab(2)
end Sub
Sub ActivateTab3()
set vShow = ActiveDocument.Variables("vShow")
vShow.SetContent 0 , true
ActivateTab(3)
end sub
regards
tim
Hello Helen,
you can set a variable in your macro. Then you can add a conditional show if(vShow=1,1,0) to your multibox
Sub ActivateTab(I)
for j = 1 to 2
Set Obj=ActiveDocument.GetSheetObject("Container_" & j)
Set ObjProp=Obj.GetProperties
ObjProp.SingleObjectActiveIndex=I
Obj.SetProperties ObjProp
next
end Sub
Sub ActivateTab1()
set vShow = ActiveDocument.Variables("vShow")
vShow.SetContent 1 , true
ActivateTab(1)
end Sub
Sub ActivateTab2()
set vShow = ActiveDocument.Variables("vShow")
vShow.SetContent 0 , true
ActivateTab(2)
end Sub
Sub ActivateTab3()
set vShow = ActiveDocument.Variables("vShow")
vShow.SetContent 0 , true
ActivateTab(3)
end sub
regards
tim
Hi Tim
Thank you for your suggestion. It works for me
Kind Regards
Helen