Optional Arguments

G

Guest

I have the following public function

Public Function Repeats(Combo As ComboBox, Combo1 As ComboBox, Optional
Combo2 As ComboBox)

It works fine when all the arguments are there, but i don't know what to do
when an argument is missing.

How do I capture the fact that there is no assigned value for Optional Combo2?
I have tried Combo2.value=Nothing , IsNull(Combo2.Value)=true, ...
What do you suggest.

I would like to do this so that i can say
If Combo2 doesn't have a value
Exit function
end if
 
P

Perry

Function testing123(optional mycombo as comboBox = nothing) as Integer
If seccombo is nothing then
Msgbox "No combo entered"
End if
End function

Krgrds,
Perry
 
G

Guest

"Is Nothing"... wow, thankyou.
--
-CLSWL


Perry said:
Function testing123(optional mycombo as comboBox = nothing) as Integer
If seccombo is nothing then
Msgbox "No combo entered"
End if
End function

Krgrds,
Perry
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top