I've built a code in the valid values tab of a property to update dinamically the valid values result array according to the user inputs. Since I don't have a static result for the Formula result that is always included in the valid values, I don't know how to set the Formula result to the first valid value dinamically.
Thanks in advance
Solved! Go to Solution.
In the Formula for the property write:
result = Me.ValidValues("PropName").Keys(0)
I also reccomend to check first if this value exist if potentially the valid values list can be empty.
Another way to do it is:
Result = ValidValues("PropertyName").FirstDisplayValue (or FirstValue, or LastDisplayValue or LastValue)
If your validvalues are dynamic it might be also worth to check if validvalues contains any value before referencing to Keys array, firstValue or anything else. Otherwise if VV will be empty you may recieve errors.