*!help!* Passing textbox as optional parameter in a function

*!help!* Passing textbox as optional parameter in a function

am 04.01.2008 17:19:49 von KayC

Hi
I am using Access2002
I have a form with 5 text boxes which are parameters to a function
3 parameters are optional in the function
How do I pass the empty textbox values to a optional parameter?
Completely stumped on how to do this
Any ideas?
Regards
KC

Re: *!help!* Passing textbox as optional parameter in a function

am 04.01.2008 17:44:18 von Fred Zuckerman

"KayC" wrote in message
news:8d132dc1-2e6f-4442-915a-287c690f9dec@1g2000hsl.googlegr oups.com...
> Hi
> I am using Access2002
> I have a form with 5 text boxes which are parameters to a function
> 3 parameters are optional in the function
> How do I pass the empty textbox values to a optional parameter?
> Completely stumped on how to do this
> Any ideas?
> Regards
> KC

Checkout the "Optional" parameter in vba Function command.
or
Use the Nz() function when you make the function call:

=TestFunction(Nz(Param1,""), Nz(Param2,""), Nz(Param3,""), Nz(Param4,""),
Nz(Param5,""))

Fred Zuckerman