Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
warfollowmy_ver
Creator III
Creator III

How select selections field in other field with macro?

Hi all!

How select selections field to other field with macro? Analog trigger doing select in field.

= '("' & getFieldSelections([field_name], '"|"', 10000, '$') & '")'

to

field_name_2

1 Solution

Accepted Solutions
tamilarasu
Champion
Champion

Sorry. By default "GetSelectedValues" syntax stores only 100 values. In your case you need to try like below,

Sub Test

Set Selections = ActiveDocument.Fields("Field1").GetSelectedValues(10000)

ActiveDocument.Fields("Field2").SelectValues Selections

End Sub

View solution in original post

5 Replies
sunny_talwar

You want to use Macro instead of select in field to select something in a field? I don't have much expertise in Macro, but would like to understand why would you prefer Macro over inbuilt QV functionality?

warfollowmy_ver
Creator III
Creator III
Author

Because I need to do this about 180 times, and to do so in the trigger for much longer than in the macro as well as the text in the macro is edited instantly, and create each time the action is very long. 😃

tamilarasu
Champion
Champion

You can try,

Sub Test

Set Selections = ActiveDocument.Fields("Field1").GetSelectedValues

ActiveDocument.Fields("Field2").SelectValues Selections

End Sub

tamilarasu
Champion
Champion

Sorry. By default "GetSelectedValues" syntax stores only 100 values. In your case you need to try like below,

Sub Test

Set Selections = ActiveDocument.Fields("Field1").GetSelectedValues(10000)

ActiveDocument.Fields("Field2").SelectValues Selections

End Sub

warfollowmy_ver
Creator III
Creator III
Author

Yes! It's work! Thank you!!!