473,657 Members | 2,432 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Passing missing values to a function from Query

PEB
1,418 Recognized Expert Top Contributor
When i'm trying to pass missing values to a function called from a query like:

Expr1:my_functi on("fdf",,"fdf" ,,,,"fd")

I always obtain an error!

I'll try using:

Eval("my_functi on('fdf',,'df', ,,,'fd')")

to see what happens!

Any other suggestions?

TIA

Vladi
Dec 14 '06 #1
7 2195
NeoPa
32,568 Recognized Expert Moderator MVP
What's the VBA of your function Vladi?
And can you post some SQL examples of trying to use it.
Dec 14 '06 #2
ADezii
8,834 Recognized Expert Expert
When i'm trying to pass missing values to a function called from a query like:

Expr1:my_functi on("fdf",,"fdf" ,,,,"fd")

I always obtain an error!

I'll try using:

Eval("my_functi on('fdf',,'df', ,,,'fd')")

to see what happens!

Any other suggestions?

TIA

Vladi
'Make sure that the number of Arguments passed to the Function matches the
'number of declared Parameters contained within the Function, both number
'and type. e.g. Passing 3 Arguments when 4 are declared within the Function,
'passing a Numeric value to a Date type. Make sure that the Function is
'declared Publically e.g. Public Function fMyFunction (Param1 As String,
'Param2 As Date, Param 3 As Boolean) As String
Dec 14 '06 #3
MMcCarthy
14,534 Recognized Expert Moderator MVP
When i'm trying to pass missing values to a function called from a query like:

Expr1:my_functi on("fdf",,"fdf" ,,,,"fd")

I always obtain an error!

I'll try using:

Eval("my_functi on('fdf',,'df', ,,,'fd')")

to see what happens!

Any other suggestions?

TIA

Vladi
Vladi

Unless the missing parameters are set as optional in the function it won't work.

Mary
Dec 15 '06 #4
PEB
1,418 Recognized Expert Top Contributor
Vladi

Unless the missing parameters are set as optional in the function it won't work.

Mary
Sure

I've tried a lot but no chance! Finnally i've done the function to accept both:

Null

and missing values and the problem is resolved!

Eval didn't work in this case!

If it worked can do a great job coz i'm using this function to send mails, and when the body is html u can guess what happens with " and ' :)

Simply in the function i've introduced the null to be acceptable value and it is Ok now!

Thanks for your suggestions!
Dec 16 '06 #5
PEB
1,418 Recognized Expert Top Contributor
'Make sure that the number of Arguments passed to the Function matches the
'number of declared Parameters contained within the Function, both number
'and type. e.g. Passing 3 Arguments when 4 are declared within the Function,
'passing a Numeric value to a Date type. Make sure that the Function is
'declared Publically e.g. Public Function fMyFunction (Param1 As String,
'Param2 As Date, Param 3 As Boolean) As String
The arguments are on the correct place but are optional! This is all of the problem obviously!

It's pitty that in the query you should use null for optional arguments, but sometimes it gives errors in some functions!

For my functions with optional parameters i'll include the nulls also like a source of missing parameter!

:)

I'll come back soon in the forum people!
Dec 16 '06 #6
MMcCarthy
14,534 Recognized Expert Moderator MVP
:)

I'll come back soon in the forum people!
We miss you Vladi

Mary
Dec 16 '06 #7
NeoPa
32,568 Recognized Expert Moderator MVP
The arguments are on the correct place but are optional! This is all of the problem obviously!

It's pitty that in the query you should use null for optional arguments, but sometimes it gives errors in some functions!

For my functions with optional parameters i'll include the nulls also like a source of missing parameter!

:)

I'll come back soon in the forum people!
Vladi,

Optional arguments does NOT mean using a Null!
If you pass a field to a function that is passing an argument - it is simply a Null argument.
In the code, the functions IsNull() & IsMissing() are two different things.
If you pass a Null to an optional string parameter, for instance, that will give an error.

HTH -Ade.
Dec 16 '06 #8

Sign in to post your reply or Sign up for a free account.

Similar topics

1
7780
by: Paul | last post by:
Hmmm, didn't seem to work. I have set session.use_cookies = 1 and session.use_trans_sid = 1 in my php.ini file. Index.php contains: ---------------------------------------------------------------------------- <?php ini_set("session.use_cookies", "off"); ini_set("session.use_trans_sid", "on"); session_start(); $_SESSION = ""; $_SESSION = ""; echo "<form method='POST' action='login.php'>
3
14928
by: domeceo | last post by:
can anyone tell me why I cannot pass values in a setTimeout function whenever I use this function it says "menu is undefined" after th alert. function imgOff(menu, num) { if (document.images) { document.images.src = eval("mt" +menu+ ".src") } alert("imgOff_hidemenu"); hideMenu=setTimeout('Hide(menu,num)',500);
58
10121
by: jr | last post by:
Sorry for this very dumb question, but I've clearly got a long way to go! Can someone please help me pass an array into a function. Here's a starting point. void TheMainFunc() { // Body of code... TCHAR myArray; DoStuff(myArray);
10
125446
by: Resant | last post by:
I have a query : Exec 'Select * From Receiving Where Code In (' + @pCode + ')' @pCode will contain more than one string parameter, eg : A1, A2, A3 How can i write that parameters, I try use : set @pCode='A1','A2','A3' but get an error : Incorrect syntax near ','
4
18044
by: dcarson | last post by:
I've read about this error in several other discussions, but still can't seem to pinpoint the problem with my code. Everything seemed to be working fine for some time, but it now tends to bomb out on me for some reason. The Summary field is pulled from a Rich Text Editor that allows HTML formatting and appears to be the culprit, but I just can't seem to figure out why. Any guidance is greatly appreciated. I'm connecting to an Access...
4
3029
by: Alfred Taylor | last post by:
I essentially need a countif() function for xsl. Something to where I could do countif(node-set, condition). Rather than try to get too extreme, i decided to just write one for my countif() with the condition hardcoded. (this was also my first venture into creating "functions") Pseudo-code is essentially this: Look at the current node and check the condition. If the condition is true, call our function again with an incremented...
2
2291
by: Keith | last post by:
Good Afternoon, New to .Net. I am trying to pass date/time values to a MS Access query depending on what value is selected from a dropdown list box (January, February, etc). I have declared those values as date datatypes and assigned their values with the # signs in front and back. When I click the submit I get the following error message: Data type mismatch in criteria expression cmdSelect1 = New OleDbCommand("Select Count(*) from ...
2
4840
by: Steve Turner | last post by:
I have read several interesting posts on passing structures to C dlls, but none seem to cover the following case. The structure (as seen in C) is as follows: typedef struct tag_scanparm { short cmd; short fdc; WORD dsf; short boxcar; short average; short chan_ena;
15
3927
by: fredindy | last post by:
I'm having trouble figuring out what I need to do here. Basically, I want to pull data from several different tables and send them to a form using open args. However, the form that is being fed need to have certain columns of data concatenated. Here is the code I have so far. I'm sure it's not right because it doesn't work right. Private Sub cmdEdit_Click() Dim sSQL As String sSQL = "Select RENTAL., RENTAL., EVENT." & _
0
8395
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8826
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8605
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
6166
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
5632
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
4306
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2726
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
1955
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1615
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.