collection is missing from arguments

Anishtain4

Registered User.
Local time
Today, 01:35
Joined
Apr 13, 2011
Messages
21
How should I understand if an optional arguments which is collection is missing? as it seems when you don't pass it, that gets the Nothing and Nothing is not missing, so the IsMissing function won't work for it
 
IsMissing only works for Variant datatypes. Look in Access help for the use of IsMissing.

JR
 
Yep I got that, but the way to check if an object is missing is: sub test(optional var as object) ..... if (variable is nothing) then ......
 
no the way to test is using

if ismissing(optionalvar)

and this test can ONLY BE TRUE for a variant parameter - as typed parameters are initialised to a default value, and can never be missing


so

myfunc(optional somevar)
- you can detect somevar as missing ie - not passed by the calling code

BUT

myfunc(optional somevar as long)
- you can not detect somevar as missing, since if it is not passed by the call, it is initiallised to 0
 

Users who are viewing this thread

Back
Top Bottom