|
-
Nov 2nd, 2000, 03:40 PM
#1
Thread Starter
Addicted Member
grrrr !
How do I test if an optional parameter as been passed to a function if the parameter is an Object ?
I know I can use IsEmpty for Variables, but objects ???
Thanks
-
Nov 2nd, 2000, 03:55 PM
#2
Instead of defining the Optional Parameter as Object, use Variant then you can use the IsMissing command, i.e.
Code:
Sub SomeSub(ByVal sString As String, Optional oObject As Variant)
If IsMissing(oObject) Then MsgBox "No Object Passed"
End Sub
Private Sub Command1_Click()
Call SomeSub("Anything")
End Sub
-
Nov 2nd, 2000, 04:15 PM
#3
Thread Starter
Addicted Member
Ah that's what I wanted ISMISSING !!!
The only thing is that I pass a control ( progrss bar ) to my function (it's a class thing, don't bother with that).
So I'll try IsMissing with controls to see if it works...
Thanks
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
|