×
INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Contact US

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

How can I make Access display a + sign in front of positive integers, just as it does - for neg?
2

How can I make Access display a + sign in front of positive integers, just as it does - for neg?

How can I make Access display a + sign in front of positive integers, just as it does - for neg?

(OP)
Really, the subject is the whole question. I have text fields on a report (General Number format), and if possible I'd like to display a + before positive numbers.

Any suggestion is appreciated.

RE: How can I make Access display a + sign in front of positive integers, just as it does - for neg?

Instead of General Number use custom format for four sections (positive, negative, zero, null) unless you format underlying data. See https://support.microsoft.com/en-us/office/format-...

combo

RE: How can I make Access display a + sign in front of positive integers, just as it does - for neg?

As combo suggests, use the format property of the text box. This is a sample you can use to start:
Format: +#,###;(#,###.##)[Red];"zero";"Empty"

Duane
Minnesota
Hook'D on Access
MS Access MVP 2001-2016

RE: How can I make Access display a + sign in front of positive integers, just as it does - for neg?

(OP)
Thank you both.

Quick question. Is +265 from the custom formatting treated as a number or text?

RE: How can I make Access display a + sign in front of positive integers, just as it does - for neg?

(OP)
Thank you both so much. This worked...but there's one small problem. The + numbers are text aligned left, while negative numbers are text aligned right. It doesn't matter what I set the alignment as. Is there some way to get the numbers to align normally to the right?

BTW Duane, I modified the sample you provided slightly, to be +#,###;-#,###.##[Red];"zero";"Empty" since I preferred simply to have a -11 displayed instead of (11), but it worked super. Now if I can just get the text alignment to cooperate I'm golden!

BTW, I tested the VarType, and it resolved as 3, or long integer.

RE: How can I make Access display a + sign in front of positive integers, just as it does - for neg?

(OP)
One more thing. I further modified the formatting to read +#,###;-#,###.##[Red];0;"Empty" since I didn't want the word zero, but instead the character 0 displayed.

I also tested the text alignment and found something curious. If I set the alignment to Left then all the text including the negative values align left, but If I set it to align right, only the negative values move. Any suggestions?

RE: How can I make Access display a + sign in front of positive integers, just as it does - for neg?

I don't get left alignment. If I change the alignment to left or right, the values appear as expected.
My format is set to: +#,###;-#,###.##[Red];0;"Empty"

Duane
Minnesota
Hook'D on Access
MS Access MVP 2001-2016

RE: How can I make Access display a + sign in front of positive integers, just as it does - for neg?

Quote (TheresAlwaysAWay)

...I didn't want the word zero, but instead the character 0 displayed
Try +#,###;-#,###.##[Red];"";"Empty"

combo

RE: How can I make Access display a + sign in front of positive integers, just as it does - for neg?

(OP)
I wrote essentially this same post and it disappeared. Either I'm losing it or Tek-Tips is! If it suddenly reappears and posts and you see it twice please don't think I'm any crazier than I actually am!

I have no idea what happened with the formatting issue. For some unknown reason it resolved itself. I have a photo of it before so you can see what I was seeing. And the two other columns displayed don't sum to the third column because they're not the two that are being compared.

Sorry the photo is so big. It was a snap from my cellphone, not a screenshot, and I was too lazy to reduce it.

Regardless, it's completely irrelevant at this point. Everything is working great.

Combo, I decided to go back to my original format of +#,###;-#,###[Red];0;"Empty" because the empty set left the field blank when the result was 0. I also removed the decimal point in the negative numbers since these are integers only.

You guys are stars and you deserve stars on your posts for all the help. I've already done it.

I really do appreciate the efforts you put forth for strangers.

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members! Already a Member? Login


Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close