SelectAll or DeselectAll from a function

SelectAll or DeselectAll from a function

For a multi-select lookup field is there a method to SelectAll or DeselectAll from a function? These statements are available in the code sections of the form.

For example I have a lookup field that shows all available skills. On the form I can use Skills_List_lookup.selectall() to check all of the boxes. But this statement is not allowed in a function.