Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
renem
Partner - Contributor III
Partner - Contributor III

Multiple value selections in a field using Actions

Can anyone tell me how to make multiple selections in a field using Actions? This is how I would've done it with a macro...

set v = ActiveDocument.Variables("MyValues")
set f = ActiveDocument.Fields("TheField")
set fv = f.GetNoValues 'empty array
a = split(v.GetContent.String,";")
for i=0 to ubound(a)
fv.Add
fv(i).Text = a(i)
fv(i).IsNumeric = false
next
f.SelectValues fv

1 Solution

Accepted Solutions
Not applicable

Hi Rene,

below a small example how you could dynamically determine the field selections of one field and apply it by clicking a button to another (data tables in the example are not connected).

View solution in original post

11 Replies
Not applicable

Hi, this is from the help:

Select in Field

Selects the values and fields that are specified. In the Search String you can specify a search mask, e.g. (A|B) will select both A and B.



You really need the parenthesis around it or it will not work.

Or do you try to do something dynamic?

-Lukas

renem
Partner - Contributor III
Partner - Contributor III
Author

Hi, I see this in the HELP, but I'm not sure how to apply it as I am using the variable to dynamically get the values that need to be selected in the field.

eg. the variable contains 'APPLE,BANANA,PEACH' and I want the field FRUIT to have these values selected

Rene

Not applicable

Hi Rene,

below a small example how you could dynamically determine the field selections of one field and apply it by clicking a button to another (data tables in the example are not connected).

renem
Partner - Contributor III
Partner - Contributor III
Author

Thanks Lukas

This works great! I just had to understand the function correctly to get it to work 🙂

paulferguson80
Contributor III
Contributor III

Hi Lukas,

Could you possibly expand on this as i have got it to work with simple field names (one word) and cant seem to get it to work on ones with spaces in them?

I have tried wildcard like brackets etc but it doesnt pick up the field with the space?

Many Thanks

Paul

Not applicable

Hi Paul,

if you post your qvw I will take a look.

Cheers, Lukas

paulferguson80
Contributor III
Contributor III

Hi Lukas,

I have attached a just for fun application that shows the example.

I would like to have a button that Selects "West Ham" and "Bradford" so we can compare the teams performance however when you push the button the current selection shows correctly but "West Ham" is not Selected?

I have tried all usual deviations as there is a space in the field but nothing seems to work?

Any help would be appreciated

Many Thanks

Paul

Not applicable

Hi Paul,

I have tried everything as well... it's not working - maybe QV doesn't like football?!?

Would suggest you make a new post - the QV Manual isn't of any help here unfortunately.

Lukas

Not applicable

Set every string in double Quotes and it works

("West Ham"|"Bradford")