By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
446,224 Members | 1,130 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 446,224 IT Pros & Developers. It's quick & easy.

Passing missing values to a function from Query

PEB
Expert 100+
P: 1,418
When i'm trying to pass missing values to a function called from a query like:

Expr1:my_function("fdf",,"fdf",,,,"fd")

I always obtain an error!

I'll try using:

Eval("my_function('fdf',,'df',,,,'fd')")

to see what happens!

Any other suggestions?

TIA

Vladi
Dec 14 '06 #1
Share this Question
Share on Google+
7 Replies


NeoPa
Expert Mod 15k+
P: 31,660
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
Expert 5K+
P: 8,669
When i'm trying to pass missing values to a function called from a query like:

Expr1:my_function("fdf",,"fdf",,,,"fd")

I always obtain an error!

I'll try using:

Eval("my_function('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
Expert Mod 10K+
P: 14,534
When i'm trying to pass missing values to a function called from a query like:

Expr1:my_function("fdf",,"fdf",,,,"fd")

I always obtain an error!

I'll try using:

Eval("my_function('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
Expert 100+
P: 1,418
PEB
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
Expert 100+
P: 1,418
PEB
'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
Expert Mod 10K+
P: 14,534
:)

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

Mary
Dec 16 '06 #7

NeoPa
Expert Mod 15k+
P: 31,660
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

Post your reply

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