Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi all,
I am trying to create a dynamic list box where values are included only when a certain value has been selected elsewhere (may even be a compound condition).
There is the function GetFieldSelections which returns the explicitly selected values of a field, but there is no corresponding function to return those 'possible' values (implicitly selected in white).
I can create a function in module that uses 'ActiveDocument.Fields(fieldname).GetPossibleValues' but I cannot call this function in an expression.
Is there a way to achieve this?
Regards,
Gordon
If I have understood ur problem correctly u can set an expression like
=IF(GetSelectedValues(FieldName)=Value, ValueToShow). Same way if u want to hide the List box u can set the expression in conditional like =IF(GetSelectedValues(FieldName)=Value,1,0) like that. IF have some othere requirement try using GetSelectedCount, GetPossibleCount etc.
Thanks for the reply Amars.
Therein lies the problem. GetFieldSelections returns those values explicitily selected (green) but not those implicitily selected (white) although there are ironically the two functions GetSelectedCount and GetPossibleCount which distinguish between them.
Regards,
Gordon
Gordon,
Did you ever find a solution. I've run into the same problem.
Thanks,
Josh
Hi Jason,
Thanks the help. The problem is I wan to return the possible values not the count of possible values. The function GetFieldSelections returns the values of everything in green. I'm looking for something like GetFieldSelections but returns all possible values (i.e values that are green and white) vice selected values (i.e. values that are green). I guess it would be called GetFieldPossible or something.
What I am trying to do is figure out if the user filtered to a specific subset of data and use this to determine what objects are displayed.
Cheers,
Josh
Concat() returns possible values. Am I misunderstanding the question?
No you're not! Wow that is much easier than I thought it would be. Thanks.
For others who come across this post:
Concat( FieldName , ',' )
will delimit each value with a comma so you can find the in the string that is returned.
i.e. item1,item2,item3 vice item1item2item3
You'd probably typically want concat(distinct FieldName,','), as without the "distinct", you'll get every occurrence of every value for the field. If you're trying to see if a value is possible, all those extra occurrences would only slow you down, even if it would still work.