Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Dear all,
I have created a list box with field being given in variable and used in list box through expression .
As, i use the field through expression the feature always select one value Option get disabled.
So, is there is any way how to always select any one value while the data in list box is in Expression.
Please suggest any answer.
Kind Regards,
Pranav
Hi,
From the help:
Always one selected:
Checking this option assures that one value will always be selected, which is useful in documents where the data only makes sense when one value is already selected, such as one currency rate etc. This option is enabled after one value is already selected in the list box. This option is not available for calculated fields.
So, it will not be possible, you should create a regular field on script.
Hope it helps,
Erich
Hi, Erich
can we do anything through writing macro.
can you please help me to write a macro to select one value when the sheet is launched.
Please suggest,
Regards,
Pranav
What is the content of your variable?
The Contents are :
1.CountryName
2.PortPair
3.CustomerName
4.CarrierName
This all feilds are put in a variable Table1
and that variable i am using in List box through expression as $(Table1).
Try whether we can do it throuogh Macro.
Regards,
Pranav
What behavior do you expect? Because I think I should make one selection to each one of these fields and make them always one selected value, but would this make sense?
Should this happen onOpen or when the variable change?
Which value should be selected?
hi,
yes i want it to happen on open of the sheet the first variable first value to be selected. rest didnt bother user can select
Regards,
Pranav
Hi, You can use a code like this:
SUB SELECT_ONE
set v = ActiveDocument.Variables("Table1")
field = v.GetContent.String
selection = activedocument.Evaluate("MINSTRING({1}" & field & " )")
ActiveDocument.Fields(field).Select selection
END SUB
You associate this with the onOpen trigger.
you can try it on the attachment
Regards,
Erich
Hi Erich,
Thanks for the suggestion,
Ok can you tell me how to clear it as the field changes the old selected field should get clear.
Regards,
Pranav
Hi, I changed the macro a little bit.
Hope it helps,
Erich