|
-
July 12th, 2001, 04:51 PM
#1
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
-
July 12th, 2001, 07:14 PM
#2
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
-
July 12th, 2001, 09:44 PM
#3
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
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|