Wrox Home  
Search P2P Archive for: Go

  Return to Index  

pro_vb thread: Passing a ListBox name to a function


Message #1 by Ian Oates <Ian.Oates@U...> on Thu, 11 Oct 2001 12:35:02 +0100
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

  Return to Index