Object array as parameter
Hi,
Is there a way to let object array as function parameter? I have different sets of Option Button on the form and I want to create a function to search a specific item on each of them(compare the Caption of the option button with a specific string). I do not want to create the similar functions for each of the Option Button arrays. What I suppose to do is create a function like:
======
Private Function GetOptionIndex(strItem As String, opt() As OptionButton) As Long
======
Here, opt() is the object array which I imaged, actually, there isn't such datatype. Can you help me?
Any suggestion will be highly appreciated.
Regards,
Michi
MCSE, MCDBA
Re: Object array as parameter
check out the following code which display the value of each option button (2 of them, with index 0 and 1).
private Function getoption(opt as Variant) as Long
Debug.print opt(1).Value
Debug.print opt(0).Value
End Function
private Sub Form_Load()
getoption Option1
End Sub
HTH
cksiow
http://vblib.virtualave.net - share our codes
Re: Object array as parameter
Thank you, HTH. It works very well. And I can also use the Object data type. That is:
private Function getoption(opt as Object) as Long
Regards,
Michi
MCSE, MCDBA