Skip to main content
Woohoo! Qlik Community has won “Best in Class Community” in the 2024 Khoros Kudos awards!
Announcements
Save $600 on Qlik Connect registration! Sign up by Dec. 6 to get an extra $100 off with code CYBERSAVE: REGISTER
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Set multi values to field via macro

Hi,

Does anyone know how to set multi values to a specific field via a macro VBScrip?

I want to create a macro that will select the values "Dad" and "Mom" at the field named "Pos".

I'v tried:

SUB SET_POS

ActiveDocument.Fields("Pos").Select "Dad", "Mom"

END SUB

But it won't do.



1 Solution

Accepted Solutions
Not applicable
Author

Select only allows one value and it deselects all other values. You need ToggleSelect. ToggleSelect will select a value and keep the current selections. If the value is already selected, it will unselect it.

ActiveDocument.Fields("Pos").Select "Dad"
ActiveDocument.Fields("Pos").ToggleSelect "Mom"


View solution in original post

2 Replies
Not applicable
Author

Select only allows one value and it deselects all other values. You need ToggleSelect. ToggleSelect will select a value and keep the current selections. If the value is already selected, it will unselect it.

ActiveDocument.Fields("Pos").Select "Dad"
ActiveDocument.Fields("Pos").ToggleSelect "Mom"


Not applicable
Author

Thanks, this is what I was looking for.