473,396 Members | 1,982 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

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

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
Jan 4 '08 #1
1 4162
"KayC" <ka******@yahoo.co.ukwrote in message
news:8d**********************************@1g2000hs l.googlegroups.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
Jan 4 '08 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Adam Dyga | last post by:
Hi, How to create function with optional parameter passed by reference? I've tried sth like this: function (&$param=NULL) // or: function (&$param=new array()) { //... }
7
by: JT | last post by:
how can i declare a function that will accept an optional parameter? something like: function newFunc(strValue1, strValue2) --where strValue2 is optional. thanks much.
7
by: (-: Dan :-) | last post by:
hi everybody suppose I have a function in a DLL function F1(var1, var2, var3) where var2 and var3 are optional parameter with default value (for exsample "-1") I create a new instance of...
4
by: Darryl Kerkeslager | last post by:
Here's the function: Public Function SaveToServer(tableName As String, prefix As String, _ changed As Date, Optional recordID As Variant) As Boolean and here's the function call that doesn't...
5
by: Vinay | last post by:
Hi, I have created a Context Menu class (CMenu) with relevant items. Based on a selected Item, I am taking a separate action. The following code is working fine. CMenu(sOption as string)...
10
by: John Morgan | last post by:
Does anyone know what parameter should be used instead of Date = 0 for the optional parameter in the following function? Public Function dhAge(ByVal dtmBD As Date, Optional ByVal dtmDate As Date...
1
by: Ed Chiu | last post by:
Hi, Is there a way to assign a DBNull value to an optional parameter of a function? I tried: Public Function AddUpdateCases( _ ByVal CrisCaseID As Integer, _ Optional ByVal APN As DateTime...
3
by: Ronald S. Cook | last post by:
I have a function in which I'm trying to make the parameter optional. However, when I put Optional in front of ByVal below I get the error "optional parameters cannot have structure types". ...
7
by: jamesclose | last post by:
My problem is this (apologies if this is a little long ... hang in there): I can define a function in VB.NET with optional parameters that wraps a SQL procedure: Sub Test(Optional ByVal Arg1...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.