Pass it as an Listbox object.
Ian Oates wrote:
>
> I have a number of ListBoxes that do the same thing (return the value
> selected). I am trying to have a generic function that I can use
>
> Code calls function 'fnGenericFunction'
>
> strSelectedItem = fnGenericFunction(lbSurname)
>
> Public fnGenericFunction(selectedListBox as control) as String
> With selectedListBox
> fnGenericFunction = .selectedItem 'or .column(0)
> End With
> End Function
>
> I would be grateful if anyone could correct the above, I am at a loss
> whether to pass the control as a string or control???
>
> Thanks
> Ian Oates