473,407 Members | 2,598 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,407 software developers and data experts.

How do I Display Negative Values as Zero (0)

I'm creating a form for a library system and in my form i would like to show the over due days of a borrowed book. I calculate that from the following equation:-
overdue days = return date - due date
(correct me if i am wrong)
and i get negative numbers for books that are not over due.
How to change that negative values to zero?
Feb 22 '12 #1
2 3749
TheSmileyCoder
2,322 Expert Mod 2GB
This is based on Ac2003, but I feel fairly confident it should work in Ac2007 as well.

You can specify the number format to use for the textbox. Select your textbox and in the property sheet find the format property and type in the following:
#;\0;\0;\0
You can see there are 4 semicolon-seperated values. The order specifees the format for:
Positive Numbers: # display the number
Negative numbers: Display a 0
0 : Display a 0
Null: Display a 0

I think that should work fine for you.
Feb 22 '12 #2
NeoPa
32,556 Expert Mod 16PB
Smiley's suggestion is a clever one, and will work as long as you don't need to store the value shown.

It will show you what you want to see, but it won't change the actual data in the control. That means the value will still be negative, even though all that shows is the zero (0).
Feb 23 '12 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

2
by: Dirk Hagemann | last post by:
Hi, Is there a datatype in python which allows no negative values? I subtract several times something from a value and I don't want to chek everytime if this value is still bigger or equal 0. ...
2
by: luke | last post by:
Could anyone, please, explain to me why I have negative values in RowModCtr column in sysobjects table? I have tested that after I update statistics the RowModCtr column is reset to 0. But why do I...
12
by: deko | last post by:
Is there an easy way to make all negative values positive in a particular table? I've been experimenting with this: Dim rst As DAO.Recordset Set rst = db.OpenRecordset("tblNegValues") Do...
4
by: dennis.joseph | last post by:
Hello Everyone, I have scoured through a million messages (ok...thats a bit exaggerated) but I just cannot figure out how to display null values in a query. I have tried Nz, IIF, Count(*) but it...
1
by: illegal.prime | last post by:
So I see from the documentation here: http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/html/frlrfSystemCollectionsArrayListClassBinarySearchTopic.asp That the code uses the...
1
by: Badis | last post by:
Hi guys, I have a negative values in my Amount column in GridView could U tell me how to display them with no (-) sign in front, knowing that my gridview is bounded to a DataView. Thanks
1
by: Badis | last post by:
Hi guys, I have a negative values in my Amount column in GridView could U tell me how to display them with no (-) sign in front, knowing that my gridview is bounded to a DataView. Thanks
6
by: billelev | last post by:
This is probably very easy, but I can't see how you would do this... I have a table that is used as a source table for a report. The table contains percentage values. In the report, I would like...
4
by: bengevik | last post by:
I need to multiplicate all the values in a coloumn with a constant and returning them in a (eventually new) column. My second problem is that there are negative values in some rows. I need to...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

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.