Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Suppressing zero display in a field

Posted on 2014-02-25
4
Medium Priority
?
256 Views
Last Modified: 2014-02-25
I am using the following in the Control Source of a text box:

=IIf([Actual supervisor hours]>0,[Actual supervisor hours],"")

What I want to do is have the field blank rather than displaying zero if the value is zero.

This displays #Error in the field.  What am I doing wrong.

Regards

Richard
0
Comment
Question by:rltomalin
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
4 Comments
 
LVL 61

Accepted Solution

by:
mbizup earned 2000 total points
ID: 39885278
Is the field formatted as a numeric field?  

Try this:

=IIf([Actual supervisor hours] >0 ,[Actual supervisor hours],NULL)
0
 
LVL 61

Expert Comment

by:mbizup
ID: 39885290
Also, make sure that the *textbox* name property is not set to "Actual supervisor hours".

If that is the name of the underlying field, name the textbox something like "txtActualSupervisorHours" to make it distinct and to avoid errors from circular references.
0
 

Author Closing Comment

by:rltomalin
ID: 39885318
Hi mbizup

Thanks again.  Yes it is a numeric textbox and it was named the same as the field.  So after I put both of those right it was fine.

Regards

Richard
0
 
LVL 58
ID: 39885404
Richard,

  Just some additional comments:

1. When you use a field reference like that, you will still see #Error if the underlying record source has no records.

2. You can also use the Format property to control how a numeric is displayed.  A format specification can be comprised of up to four sections.   First is for positive numbers, second negatives, third zeros, and forth Nulls.

  If you don't use a section, then it defaults to the first specified.  For example:

"$#,##0;;\Z\e\r\o"

  Specifies a first and third value, so positives and negatives use the $#,##0 specification, and zeros would display as 'Zero'

HTH,
Jim.
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article describes two methods for creating a combo box that can be used to add new items to the row source -- one for simple lookup tables, and one for a more complex row source where the new item needs data for several fields.
The Windows Phone Theme Colours is a tight, powerful, and well balanced palette. This tiny Access application makes it a snap to select and pick a value. And it doubles as an intro to implementing WithEvents, one of Access' hidden gems.
Using Microsoft Access, learn some simple rules for how to construct tables in a relational database. Split up all multi-value fields into single values: Split up fields that belong to other things into separate tables: Make sure that all record…
In Microsoft Access, learn how to use Dlookup and other domain aggregate functions and one method of specifying a string value within a string. Specify the first argument, which is the expression to be returned: Specify the second argument, which …

597 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question