473,395 Members | 1,496 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

Problem With IIf Statement

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
3 1316
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
* 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
Thanks folks. I thought it would be something simple.

Jul 18 '06 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

68
by: Marco Bubke | last post by:
Hi I have read some mail on the dev mailing list about PEP 318 and find the new Syntax really ugly. def foo(x, y): pass I call this foo(1, 2), this isn't really intuitive to me! Also I...
4
by: Dani | last post by:
Hi everyone Description of the problem: Using a PreparedStatement to write down an integer (int) plus a timestamp for testing purposes. When read out again the integer looks very different. We...
3
by: Andy_Khosravi | last post by:
I have been trying to build a user friendly search engine for a small database I have created. I'm having some particular problems with one of my date fields. Here's the setup: I'm using...
1
by: tom.eeraerts | last post by:
Hello, I have a problem migrating an application from v5r2 to v5r3. The problem is with the prepared statements. To see what the problem is, i extracted a small piece of code and debugged the...
3
by: shark | last post by:
Hi all. i am facing a deadlock problem .i have included the -t1204 and -T3605 trace flags and have got the following o/p pu tin sqls server logs. 2006-06-01 17:49:21.84 spid4 2006-06-01...
2
by: mob1012 via DBMonster.com | last post by:
Hi All, I wrote last week about a trigger problem I was having. I want a trigger to produce a unique id to be used as a primary key for my table. I used the advice I received, but the trigger is...
8
by: Ian Mackenzie | last post by:
Hi Guys I am VERY new to DB2 and have created a workingdays function to return the working days between 2 dates, but I get some compiler errors when running it: CREATE FUNCTION WORKINGDAYS...
22
by: b_r | last post by:
Hi, I'm trying to make a simple operation (insert into DB) in VB 2005 and SQL Server. The code is as follows: Dim sConnectionString As String = _ "Data...
3
by: Tony K | last post by:
I'm note sure how to state this but, I have a Windows form that contains 2 tables. Details View on top and Datagrid on the bottom. The two tables are related. One of the fields in the details...
0
by: aashiss03 | last post by:
hi everyone I m restorimg a database , during which i m facing the peoblem Here is the details description the problem. RESTORE DATABASE NSWD FROM "C:\db2_backups" TAKEN AT...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.