Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Optional Object Parameter

Status
Not open for further replies.

moonmonkey

Programmer
Jul 16, 2002
14
0
0
GB
I'm trying to write a vb function in which the developer may or may not pass an ImageList object as the final optional parameter. The question is, how do you check to see if the object was passed or not? I've tried isnull(ObjectParameterName), isempty(ObjectParameterName), and ismissing(ObjectParameterName), but none of these methods appear to return the desired value.

Can this be done?
 
I cracked this one myself!

If Not ListIconsControl Is Nothing Then

'object has been passed!

end if

easy when you know how!
 
>I cracked this one myself!

Love hearing that...
 
Note: IsMissing(ObjectParameterName) will also work if ObjectParameterName is declared as a variant parameter in the called function.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top