#Error

D

Doc Rock

I'm getting a #Error when I try to print the result of a query.
Sometimes the result ([paytype]) is "" and sometimes "D". I'm using

=IIf(IsNull([paytype]),"ch",[paytype])

but this isn't getting the results I want. Paytype is a string that is
set for Space$(0) as the default. Is there something other than IsNull
that would work? I have tried Nz, but that isn't correct, either.

Thanks

Doc Rock
 
D

Damian S

Hi Doc Rock...

How about checking for an empty string (which is different to NULL):

=IIf(IsNull([paytype]) or ([paytype] = ""),"ch",[paytype])

Damian.
 
D

Doc Rock

Damian,
That still doesn't work. I also tried
=IIf(IsNull([paytype]) Or Len([paytype])=0,"ch",[paytype])

Is there a way to find out what [paytype] really is? ie a null string or
some other thing I can test for? Can I test for Space$(0)??? I'll try
that...

Doc Rock

Damian said:
Hi Doc Rock...

How about checking for an empty string (which is different to NULL):

=IIf(IsNull([paytype]) or ([paytype] = ""),"ch",[paytype])

Damian.


Doc Rock said:
I'm getting a #Error when I try to print the result of a query.
Sometimes the result ([paytype]) is "" and sometimes "D". I'm using

=IIf(IsNull([paytype]),"ch",[paytype])

but this isn't getting the results I want. Paytype is a string that is
set for Space$(0) as the default. Is there something other than IsNull
that would work? I have tried Nz, but that isn't correct, either.

Thanks

Doc Rock
 
D

Doc Rock

Nope, Space$(0) doesn't work either...

Damian said:
Hi Doc Rock...

How about checking for an empty string (which is different to NULL):

=IIf(IsNull([paytype]) or ([paytype] = ""),"ch",[paytype])

Damian.


Doc Rock said:
I'm getting a #Error when I try to print the result of a query.
Sometimes the result ([paytype]) is "" and sometimes "D". I'm using

=IIf(IsNull([paytype]),"ch",[paytype])

but this isn't getting the results I want. Paytype is a string that is
set for Space$(0) as the default. Is there something other than IsNull
that would work? I have tried Nz, but that isn't correct, either.

Thanks

Doc Rock
 
D

Doc Rock

Found my error: I had named the fields incorrectly in all my debugging,
and was referring to itself! Once I renamed the fields correctly, it
works better.

Now on to the next problem:
I can get it to sort of work using an Iif statement, but if I try a
function, The function returns an #Error. If I try to debug the
function in the immediate window, I get a box saying it's not a defined
function, even though I can see it in my code, and I'm pretty sure I
have spelled it the same both times(!) I may be worrying about nothing,
since I already have a working solution, but now I'm trying to learn!!! <g>

Doc Rock

Damian said:
Hi Doc Rock...

How about checking for an empty string (which is different to NULL):

=IIf(IsNull([paytype]) or ([paytype] = ""),"ch",[paytype])

Damian.


Doc Rock said:
I'm getting a #Error when I try to print the result of a query.
Sometimes the result ([paytype]) is "" and sometimes "D". I'm using

=IIf(IsNull([paytype]),"ch",[paytype])

but this isn't getting the results I want. Paytype is a string that is
set for Space$(0) as the default. Is there something other than IsNull
that would work? I have tried Nz, but that isn't correct, either.

Thanks

Doc Rock
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Top