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

Run-time error '64479' ???

P: n/a
MLH
I have the following in a global module:
Global Const ZLS$ = ""

Yet, when I run the following in the debug windo of A97...
?Nz(DSum("[PmtAmt]", "tblPmtsRcd", "[VehicleJobID]=GetMyVariant() AND
[InvoiceNumber] = ZLS"), 0)

.... I get the following error ...
Run-time error '64479'. The expression you entered as a query
parameter produced this error: "Microsoft Access Can't find the name
'ZLS' you entered in the expression"

At the same time, if I run the following in the debut window, Access
seems to have no trouble at all knowing that ZLS equals quote quote.
if ZLS="" then ?"Hello"
Hello

Is there an intrinsic constant I can use to represent a zero length
string? I don't see why it should, but maybe that'll work.
May 12 '07 #1
Share this Question
Share on Google+
3 Replies


P: n/a
MLH wrote:
I have the following in a global module:
Global Const ZLS$ = ""

Yet, when I run the following in the debug windo of A97...
?Nz(DSum("[PmtAmt]", "tblPmtsRcd", "[VehicleJobID]=GetMyVariant() AND
[InvoiceNumber] = ZLS"), 0)

... I get the following error ...
Run-time error '64479'. The expression you entered as a query
parameter produced this error: "Microsoft Access Can't find the name
'ZLS' you entered in the expression"

At the same time, if I run the following in the debut window, Access
seems to have no trouble at all knowing that ZLS equals quote quote.
if ZLS="" then ?"Hello"
Hello

Is there an intrinsic constant I can use to represent a zero length
string? I don't see why it should, but maybe that'll work.
From the debug window
? acExport
1
acExport is an intrinsic contant

Now try to run any query using acExport or any other Access intrinsic
constant. You will be prompted for the value of.

I would forget your method and simply supply the value. You might not
like it but that's the way it is.
May 12 '07 #2

P: n/a
On Sat, 12 May 2007 11:12:31 -0400, MLH <CR**@NorthState.netwrote:

Why do you always want to do things the hard way? Replace:
Global Const ZLS$ = ""
with use of:
vbNullString

That's not the problem here; the problem is that you expect Access to
replace your variable name with its value.
"select * from sometable where somefield=myvariable"
should be written as:
"select * from sometable where somefield=" & myvariable
(or quotes around it if somefield is a text field)

-Tom.

>I have the following in a global module:
Global Const ZLS$ = ""

Yet, when I run the following in the debug windo of A97...
?Nz(DSum("[PmtAmt]", "tblPmtsRcd", "[VehicleJobID]=GetMyVariant() AND
[InvoiceNumber] = ZLS"), 0)

... I get the following error ...
Run-time error '64479'. The expression you entered as a query
parameter produced this error: "Microsoft Access Can't find the name
'ZLS' you entered in the expression"

At the same time, if I run the following in the debut window, Access
seems to have no trouble at all knowing that ZLS equals quote quote.
if ZLS="" then ?"Hello"
Hello

Is there an intrinsic constant I can use to represent a zero length
string? I don't see why it should, but maybe that'll work.
May 12 '07 #3

P: n/a
MLH
>On Sat, 12 May 2007 11:12:31 -0400, MLH <CR**@NorthState.netwrote:
>
Why do you always want to do things the hard way? Replace:
Global Const ZLS$ = ""
with use of:
vbNullString
Actually, typing "" was not as hard as typing vbNullString
>
That's not the problem here; the problem is that you expect Access to
replace your variable name with its value.
"select * from sometable where somefield=myvariable"
should be written as:
"select * from sometable where somefield=" & myvariable
(or quotes around it if somefield is a text field)
Thanks for your suggestion, but...
Its much simpler to to reference FN GetZLS() which returns "".
May 12 '07 #4

This discussion thread is closed

Replies have been disabled for this discussion.