Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Automatic selection

Hi,

I have two tables where one is the parent table and one is a child table. As per usual, one parent can have several children, however the child only has one parent. Now if I select one parent, the child table will show me the correct kids, and grey out the rest, but in order for me to actually select the kids (make them green) i need to click on them. Is there any way for me to negate that step? I.e. is there any way for me to automatically select the kids just by selecting the parents?

Cheers,

Nils

1 Solution

Accepted Solutions
sundarakumar
Specialist II
Specialist II

Hi Nils,

You dont have to run macro for this purpose. This can be achived with triggers...

Go to Settings -> document Properties -> triggers ,then select the parent field and add 'select possible' trigger for all the child fields.

Please find the attachment which shows it clearly.

image.PNG.png

-Sundar

View solution in original post

10 Replies
tresesco
MVP
MVP

Try using a trigger : Select Possible

Not applicable
Author

how would i do that? im not really good at expressions ...

tresesco
MVP
MVP

Could you please share your sample app?

michael_maeuser
Partner Ambassador
Partner Ambassador

you can run a macro

sub SelectPossibleValues

ActiveDocument.Fields("ChildField").SelectPossible

end sub

additionally set a trigger on the sheet for running macro:

=if(GetSelectedCount(ParentField)>0,  'SelectPossibleValues')

Not applicable
Author

thanks micheal, however i really dont know where to place this macro. i have attached a sample file of what i am trying to do to examplify this.

sundarakumar
Specialist II
Specialist II

Hi Nils,

You dont have to run macro for this purpose. This can be achived with triggers...

Go to Settings -> document Properties -> triggers ,then select the parent field and add 'select possible' trigger for all the child fields.

Please find the attachment which shows it clearly.

image.PNG.png

-Sundar

saumyashah90
Specialist
Specialist

What will Select Possible do?
->When you chose a field Name for example shown below child1 then it will select(child1) and all possible values related to that field name

If you dont want to select two or more field names then
->'(Field1|Field2|Field3)'

Hope you will UnderStand this

tresesco
MVP
MVP

It is always better to use trigger rather than a macro. PFA.

trig.png

Not applicable
Author

tnx, this worked perfectly!