Solved

Suppressing zero display in a field

Posted on 2014-02-25
4
251 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 500 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

PeopleSoft Has Never Been Easier

PeopleSoft Adoption Made Smooth & Simple!

On-The-Job Training Is made Intuitive & Easy With WalkMe's On-Screen Guidance Tool.  Claim Your Free WalkMe Account Now

Question has a verified solution.

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

Access custom database properties are useful for storing miscellaneous bits of information in a format that persists through database closing and reopening.  This article shows how to create and use them.
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.
Familiarize people with the process of utilizing SQL Server views from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Microsoft Access…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…

688 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