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

Problem With IIf Statement

P: n/a
I'm using the following IIf statement as the control source for a text
box on a report.

=IIf([WOnumber]=0,"",[WOnumber])

It works fine if "WOnumber" is numeric but gives an error if "WOnumber"
is alphanumeric. I don't understand this. If anyone can suggest a
fix, it would be appreciated.

Jul 17 '06 #1
Share this Question
Share on Google+
3 Replies


P: n/a
On 17 Jul 2006 16:47:17 -0700, Wayne wrote:
I'm using the following IIf statement as the control source for a text
box on a report.

=IIf([WOnumber]=0,"",[WOnumber])

It works fine if "WOnumber" is numeric but gives an error if "WOnumber"
is alphanumeric. I don't understand this. If anyone can suggest a
fix, it would be appreciated.
If the field can be alphanumeric, then it is a Text datatype field,
not a Number datatype.

=IIf([WOnumber]="0","",[WOnumber])

Also, make sure the name of the control is not WOnumber.
--
Fred
Please respond only to this newsgroup.
I do not reply to personal e-mail
Jul 18 '06 #2

P: n/a
* Wayne:
I'm using the following IIf statement as the control source for a text
box on a report.

=IIf([WOnumber]=0,"",[WOnumber])

It works fine if "WOnumber" is numeric but gives an error if "WOnumber"
is alphanumeric. I don't understand this. If anyone can suggest a
fix, it would be appreciated.
Probably this. You're comparing WOnumber to a number (0) which tells
Access to convert to a number. If it's alpha data, it can't. Obviously
it's not a numeric field. Are you actually storing a 0 in it?

If so, try:
=IIf([WOnumber]="0","",[WOnumber])

--
Randy Harris
tech at promail dot com
I'm pretty sure I know everything that I can remember.
Jul 18 '06 #3

P: n/a
Thanks folks. I thought it would be something simple.

Jul 18 '06 #4

This discussion thread is closed

Replies have been disabled for this discussion.