Solved

Formatting a Dummy field

Posted on 2016-08-22
9
67 Views
Last Modified: 2016-08-23
Experts,

I have a union query with a dummy field ("" as AmountDummy in the SELECT statement)
This dummy field doesnt conditionally format in my report. (ie the conditional formatting for <0 and turn text red) and the negative sign on the number doesnt go away on any format I apply.  The following is the format I have in the control source on the report:
=Format([AmountDummy],"(#,##0.00)")
and it appears like this: -(25.50) - note the negative sign.

How do I format this field red for a negative number and get rid of the "-" sign and use parenthesis for negatives?

thank you
0
Comment
Question by:pdvsa
[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
9 Comments
 
LVL 57
ID: 41765743
You pass multiple formats....1st is positive #'s, 2nd negative, 3rd zero, and 4th null, so:

#,##0.00;(#,##0.00)[Red];"Zero";"Null"

Jim
0
 

Author Comment

by:pdvsa
ID: 41765770
Ok I think I got that but have a follow up.  

It turns the text red, which is what I want but it doesnt remove the "-" sign and there are no parenthesis.  I put the format in the formatting in the space below the control source in the properties sheet.

what do you think is the issue?
0
 
LVL 57
ID: 41765819
Hum, works fine here.   I opened the VBA editor and the debug window (Ctrl/G) and typed in:

? Format(-123.45,"#,##0.00;(#,##0.00)[Red]")

and got

(123.45)

Jim.
0
Technology Partners: 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!

 

Author Comment

by:pdvsa
ID: 41765840
I think this field is a little different since its a dummy field but maybe i should drag the field into the rpt again and test.  Possibly the field has an odd format format since I have been made a few changes to the field.  Will try when i wake up in a few hours because im not in the us now and not in front of computer.
0
 

Author Comment

by:pdvsa
ID: 41766275
Hi Jim,

Ok back at the computer.  I dragged in a new [AmountDummy] field and applied the format #,##0.00;(#,##0.00)[Red];"Zero";"Null"  as described above but there is no format applied to the field.  

I mentioned in my previous post that the field turns red but after second look it was because of a conditional format I applied (<0 and apply text font color red).

I am sure it is because this field is not a "normal" field like the others because it is dummy.  the  formatting #,##0.00;(#,##0.00)[Red];"Zero";"Null" works on other fields.

the record source is a union if that makes a difference.  thank you.  If you have any other ideas let me know.  

thank you
0
 
LVL 37

Expert Comment

by:PatHartman
ID: 41766323
I'm confused.  If the value of the dummy field is "" which is a zero length string, what is there to format?  If you want it to be zero, make the value zero rather than "".
0
 
LVL 50

Accepted Solution

by:
Gustav Brock earned 500 total points
ID: 41766575
I have a union query with a dummy field ("" as AmountDummy in the SELECT statement)
I believe that is your issue. With "" as the dummy value, the values from other sections of the union query also turn into string, thus your output is strings, not numbers.

Try changing the dummy value to Null.
Or you may have to use the union query as source in a new select query. In this you convert your strings to numbers (currency) which you can format as you intend.

/gustav
0
 
LVL 57
ID: 41766727
<<I mentioned in my previous post that the field turns red but after second look it was because of a conditional format I applied (<0 and apply text font color red).>>

  Did you remove the conditional format then?

  and as gustav said, the data type must be correct (numeric)

Jim.
0
 

Author Closing Comment

by:pdvsa
ID: 41767426
Thank you Gustav.  This is what it was...
0

Featured Post

Revamp Your Training Process

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action.

Question has a verified solution.

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

I see at least one EE question a week that pertains to using temporary tables in MS Access.  But surprisingly, I was unable to find a single article devoted solely to this topic. I don’t intend to describe all of the uses of temporary tables in t…
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.
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …

752 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