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. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
#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
|
|||
|
|||
#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
|
|||
|
|||
#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
|
|||
|
|||
#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
|
|||
|
|||
#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 | |
|
|