A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Setting Up & Running Reports
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

#Error



 
 
Thread Tools Display Modes
  #1  
Old February 16th, 2007, 02:45 AM posted to microsoft.public.access.reports
Doc Rock
external usenet poster
 
Posts: 7
Default #Error

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
  #2  
Old February 16th, 2007, 03:58 AM posted to microsoft.public.access.reports
Damian S
external usenet poster
 
Posts: 741
Default #Error

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" wrote:

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

  #3  
Old February 19th, 2007, 03:27 AM posted to microsoft.public.access.reports
Doc Rock
external usenet poster
 
Posts: 7
Default #Error

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 S wrote:
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" wrote:

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

  #4  
Old February 19th, 2007, 03:31 AM posted to microsoft.public.access.reports
Doc Rock
external usenet poster
 
Posts: 7
Default #Error

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

Damian S wrote:
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" wrote:

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

  #5  
Old February 19th, 2007, 04:00 AM posted to microsoft.public.access.reports
Doc Rock
external usenet poster
 
Posts: 7
Default #Error

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 S wrote:
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" wrote:

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

 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 11:30 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.