Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi,
I've a list box with field with presentation LED CheckBoxes. Now i want to store marked values of this listbox into variable to achive this i taken button action with variable and give value for this variable with code =GetFieldSelections(Group,',',20).
Upto here it is fine. If i taken expression in the listbox it is not able store selections. How can i overcome this.
Hi,
I'm not sure why it didn't work.
I reproduce your sceneario and it is working.
Please, check attachment.
Hope it helps,
Erich
Erich,
I'm using personal edition can say the procedure please.
Sorry... I think I got it wrong in the first time.
You need it to automatically store the selections without the button?
In this case,
You can go to setttings-> document Properties -> Triggers
Select your field, click on add Actions and the rest will be just like the button.
Actually why i'm trying to do this i had list boxes like following image:
- If i select Group in 1st listbox it should automatically select all data in 2nd listbox. i.e like this
- For this i return a macro based on listbox and to work this i return a expression in listbox.
- Is there any other solution to do this.
- The think is if i select Group it should automatically select all data in 2nd listbox and if i unselect Group it should deselect all the data in 2nd listbox.
- And user can choose again selection in 2nd listbox after selecting in 1st group.
But if listbox contains expression how can i achive this..
Ok,
Please include this code in your macro module:
SUB selPossible
set val=ActiveDocument.Fields("GROUP").GetSelectedValues
IF ( val.Count >0) THEN
ActiveDocument.Fields("MEMBER").SelectPossible
ELSE
ActiveDocument.Fields("MEMBER").CLEAR
END IF
end sub
It wil get selections in the field GROUP to apply in the FIELD MEMBER.
If the user de-select group, it will clear the MEMBER
You should call this macro from the onSelect and onChange trigger of the field GROUP
(at settings->document properties -> triggers)
(You need to change the code to work with your own fields)
Hope this helps,
Erich