What is wrong with this code?

  • Thread starter Thread starter Mike W.
  • Start date Start date
M

Mike W.

=IIf(IsNull([askowo]),"None",[askowo])

It is supposed to print "None" if the field [askowo] is null, otherwise
print the work order number.

It works just fine in one report, but not in another.

TIA,

Mike W.
 
What does it do in the one it doesn't work? Is there a textbox also called
"askowo" (including the textbox this expression is in)? If so, Access may
not now whether to use the textbox or the field. Is there more than one
field called "askowo" in the report's Record Source? If so, you may need to
specify the table name also ([TableName].[askowo]).

While it won't fix the problem, it would be shorter to write:

=Nz([askowo], "None")
 
Wayne Morgan said:
What does it do in the one it doesn't work? Is there a textbox also called
"askowo" (including the textbox this expression is in)? If so, Access may
not now whether to use the textbox or the field. Is there more than one
field called "askowo" in the report's Record Source? If so, you may need
to specify the table name also ([TableName].[askowo]).

While it won't fix the problem, it would be shorter to write:

=Nz([askowo], "None")


Wow! You're fast!

I realized that I did not include the error as I hit send and you beat me to
the repost.lol

#Error is what shows on the report that does not work.

Yep, you got it! The text box was named askowo. I changed the name and it
works just fine now.

Thanks!

Mike W.
 
Back
Top