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

Displaying negative values in a report with parentheses around them

119 100+
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 to display percentage values less than zero with parentheses around them. I can change the color, format etc. but I'm not sure how you would enclose a particular field in this way.

e.g. -5.6% becomes (5.6%)
Nov 8 '07 #1
6 9065
Jim Doherty
897 Expert 512MB
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 to display percentage values less than zero with parentheses around them. I can change the color, format etc. but I'm not sure how you would enclose a particular field in this way.

e.g. -5.6% becomes (5.6%)

Create a query and place the numeric field in the query grid now in the column to the right of that type this (where 'pcent' represents your field name). You could then base your report on the query (obviously you would add other fields from your table to do that.

The calculated column strPercent then becomes available in your report as a string value in addition to your numeric value so you have the best of both worlds

Expand|Select|Wrap|Line Numbers
  1. strPercent: "(" & CStr([pcent]) & "%)"
Regards

Jim :)
Nov 8 '07 #2
billelev
119 100+
Thanks, Jim. So I guess it is not possible to do it directly in the report itself, then?
Nov 8 '07 #3
Jim Doherty
897 Expert 512MB
Thanks, Jim. So I guess it is not possible to do it directly in the report itself, then?

I personally always make reports based on queries, the queries of which I make give me the data to provide for the report.

You can do this in the report only if you wish, but it would be a calculated control like a textbox that would take the value of whatever is in the percent textbox and format it in much the same way ie in an unbound textbox enter into its controlsource

Expand|Select|Wrap|Line Numbers
  1.  ="(" & CStr([pcent]) & "%)"
Jim :)
Nov 8 '07 #4
missinglinq
3,532 Expert 2GB
Actually, you can do this in a report, a form or a table (anywhere where the Format property is available) for currency/number datatype fields by placing

0;(0)

in the Format property!

Linq ;0)>
Nov 8 '07 #5
billelev
119 100+
Actually, you can do this in a report, a form or a table (anywhere where the Format property is available) for currency/number datatype fields by placing

0;(0)

in the Format property!

Linq ;0)>
Perfect! That is exactly what I was looking for. Thanks.
Nov 9 '07 #6
missinglinq
3,532 Expert 2GB
Glad we could help!

Linq ;0)>
Nov 9 '07 #7

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

Similar topics

4
by: Joe User | last post by:
Hi all....I have a feeling this is going to be one of those twisted query questions, but here it goes anyways.... I want to generate a report that shows the chronology of events (represented by...
5
by: pelcovits | last post by:
How do I get Access to put a blank in a report column (but not eliminate the record completely), when the field in question is currency format, and the value is zero? My understanding is that null...
4
by: Andy Davis | last post by:
I have developed a number of reports that are based on parameter queries where the user enters criteria such as a date range and a sales rep say. I want to be able to show a graphical picture in...
2
by: MLH | last post by:
Am using code below to display memory status. Problem with 4th and 5th ones (dwTotalPageFile and dwAvailPageFile). They show up as NEGATIVE. Why might that be? 'xxxxxxxxxxxxxxxBEGIN...
34
by: Sona | last post by:
I need to find a minimum of three float values.. what would be the most efficient way of doing this? Can someone please share a #define macro or something with me for doing this? Thanks Sona
11
by: tlyczko | last post by:
Hello Rob B posted this wonderful code in another thread, http://groups.google.com/group/comp.lang.javascript/browse_thread/thread/c84d8538025980dd/6ead9d5e61be85f0#6ead9d5e61be85f0 I could not...
39
by: Frederick Gotham | last post by:
I have a general idea about how negative number systems work, but I'd appreciate some clarification if anyone would be willing to help me. Let's assume we're working with an 8-Bit signed integer,...
1
by: jeffrey.bergstedt | last post by:
I'm using VBA to dynamically add rows of textboxes to a Report, then assign values to those textboxes. The values are definitely being assigned as I can MsgBox them afterward and the values come...
10
by: mirandacascade | last post by:
Question toward the bottom of this post....background information immediately below. Access 97 SQL Server 2000 Please note: although the subject line uses the word 'bloat', this post is NOT...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

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.