473,698 Members | 2,594 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

*!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 4194
"KayC" <ka******@yahoo .co.ukwrote in message
news:8d******** *************** ***********@1g2 000hsl.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(N z(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
3832
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
36586
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
14187
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 my class and then I call F1.
4
4103
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 work: success = SaveToServer("obligation", "obl", Me!updated, Me.txtID)
5
6578
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) .... TM = New ContextMenu
10
11952
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 = 0) As Short
1
1794
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 = System.DBNull.value)
3
7337
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". Public Function SelectPenType(ByVal PenTypeID As Guid) As DataSet Implements IPen.SelectPenType Any idea how I should be doing this? Thanks,
7
7056
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 As Integer = 0, _ Optional ByVal Arg2 As Integer = 0, _ Optional ByVal Arg3 As Integer = 0) ' Call my SQL proc with the same signature
0
8609
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9030
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
8871
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
6525
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5861
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4621
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3052
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
2333
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2007
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.