Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi,
I was wondering if there is a way to change a variable when the CLEAR button is clicked?
I have some date buttons that change colour when selected. they are blue but when one is clicked it changes to red (just so the user can see which date selection is active). When i clear selections the button still stays red.
Can anyone help me please?
Thanks
no, the only thing that set the variable are 5 date button. but obviously when clearing the selections these dates are cleared also (which is correct). nothing else sets the variable value.
it works perfectly if i remove the BranchView selection, but i need this selected always.
Try this ...
=if(
Trim(Replace('BranchView: ' & GetFieldSelections(BranchView),GetCurrentSelections(),''))='','')
Or perhaps if you can upload an example, maybe there's a better way!
flipside
hi flipside,
I have attached a quick sample..
i have set a clear state so when clear is clicked it selects 'BranchView = Branch'
there is a variable called vDateRange
the buttons set the variable and make a date selection, and the button colours are calculated based on the variable value.
Any more help would be greatly appreciated
Must be the Clear State causing it to do this - I have never used this option!
Not sure of a way around it at the moment, but if I think of something I'll post a reply.
OK, forget the triggers - too complicated. try these expressions for your button colours ...
=if(vDateRange='YTD' and not(Trim(Replace(Replace('BranchView: ' & GetFieldSelections(BranchView),GetCurrentSelections(),''),'BranchView:',''))=''),RGB(255,0,0), RGB(0,0,255))
=if(vDateRange='MTD' and not(Trim(Replace(Replace('BranchView: ' & GetFieldSelections(BranchView),GetCurrentSelections(),''),'BranchView:',''))=''),RGB(255,0,0), RGB(0,0,255))
flipside
Hi,
I actually got this working by resetting the clear state, adding a list box for the BranchView field, then in the properties of that list box i ticked 'Always one Selected Value'. Deleted the list box.
That gave the same result as using the 'Set Clear State' option.
Then i used your solution above..
=if(
Trim(Replace('Region: ' & GetFieldSelections(Region),GetCurrentSelections(),''))='','',1)
Which did the trick
Thanks for your help!