Results 1 to 5 of 5
  1. #1
    Silver Lounger
    Join Date
    Dec 2000
    Location
    California, USA
    Posts
    1,758
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Number Format on Reports (97:SR2)

    I would like to have all zero in my report appear as "-". This would be equivalent to the "accounting format" in XL.

    Any assistance would be appreciated.
    John

  2. #2
    5 Star Lounger
    Join Date
    Jan 2001
    Location
    Newbury, Berkshire, England
    Posts
    712
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Number Format on Reports (97:SR2)

    Place an unbound text box on your form near the text box bound to the value you want to change to the "-"

    Put the following code in the control source of the unbound text box replacing Test_0 with the name of the bound text box.

    =IIf([Test_0]=0,"-",[Test_0])

    Once you have got this working, you will need to hide the bound text box, the best way to do this would be to change the text colour to white, now slide your new unbound text box over until it covers the bound text box.

  3. #3
    5 Star Lounger
    Join Date
    Jan 2001
    Location
    Newbury, Berkshire, England
    Posts
    712
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Number Format on Reports (97:SR2)

    By the way setting the bound text box property "visible" to no also works!

    For some strange reason I thought if you set the "visible property" to no the information in the text box wouldn't be available for the calculation, now I'm puzzled, can't understand where I got that idea from.

  4. #4
    Plutonium Lounger
    Join Date
    Dec 2000
    Location
    Sacramento, California, USA
    Posts
    16,775
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: Number Format on Reports (97:SR2)

    I seem to recall something like that way back in early versions of Access ... but after 10 years and 7 versions, I may be getting confused. <img src=/S/grin.gif border=0 alt=grin width=15 height=15>
    Charlotte

  5. #5
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Number Format on Reports (97:SR2)

    You can set the Format property of the text boxes to a custom number format. A number format can have up to 4 sections, separated by semicolons.
    The first section is for positive numbers, the second for negative numbers, the third for zero values and the fourth for null (empty) values. For example, a format
    <font face="Georgia">0.00;<!t>[Red]<!/t>(0.00);-</font face=georgia>
    will display positive number with two decimals, negative numbers with two decimals in red and enclosed in parentheses, and zero values as a dash. The before the dash is inserted by Access to indicate that it's a literal character and not a minus sign.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •