Results 1 to 10 of 10
  1. #1
    Bronze Lounger
    Join Date
    Jan 2001
    Location
    Alzano Lombardo, Italy
    Posts
    1,483
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Decimals Display in a Report (2003)

    I can't get the RFermiTotSGB report in the attached mdb to show decimals only when they're actually present as in the RFermi2SGB report.
    What can I do?
    Attached Files Attached Files

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

    Re: Decimals Display in a Report (2003)

    Set the Format property of the text boxes to a format that allows decimal places.

  3. #3
    Bronze Lounger
    Join Date
    Jan 2001
    Location
    Alzano Lombardo, Italy
    Posts
    1,483
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Decimals Display in a Report (2003)

    Thank you Hans, I tried using the format #,##0.#;-#,##0.#;"" but when there are no decimals a dot appears at the end. Is there a way to remove it?
    Why are the decimals showing in the RFermi2SGB report even though the format doesn't allow decimal places?
    Attached Files Attached Files

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

    Re: Decimals Display in a Report (2003)

    1) Set the format to General Number.
    2) Because not all text boxes have the same Format - some allow decimals, others don't.

  5. #5
    Bronze Lounger
    Join Date
    Jan 2001
    Location
    Alzano Lombardo, Italy
    Posts
    1,483
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Decimals Display in a Report (2003)

    Thank you Hans <img src=/S/smile.gif border=0 alt=smile width=15 height=15>
    2) slipped through the cracks <img src=/S/blush.gif border=0 alt=blush width=15 height=15>

  6. #6
    Star Lounger
    Join Date
    Mar 2001
    Location
    Dudley, Midlands, England
    Posts
    55
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Re: Decimals Display in a Report (2003)

    Edited by HansV to display <!t>[red] instead of red text.

    I've got a problem that's similar enough that it didn't seem worth starting a new thread.

    I have a field which can contain positive or negative numbers. The positive numbers may have a decimal part but may be whole numbers. I would like to use the General Number convention to display the positive values i.e. for decimal values, a decimal point and one or more digits after it, but for integers I would just like to display the integer part with no decimal point. However for negative numbers, I would like to use a specific format ("0.00<!t>[red]"). (sorry, that format should have the word 'red' in square brackets as part of it, but I don't know how to make that appear correctly, it just colours the subsequent text red instead)

    If there any way I can combine the two using the Format property, or would I need to do something different.

    Thanks,

    Simon

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

    Re: Decimals Display in a Report (2003)

    As far as I know, that is possible in Excel, but not in Access.

    BTW, you can make text in a post red by placing <!t>[red] before it and <!t>[/red] after it, for example <!t>[red]blue<!t>[/red] becomes <font color=red>blue</font color=red> when posted.
    If you want to display the word red surrounded by square brackets, you must use <!t>[t]<!/t> for [ and <!t>[/t]<!/t> for ], so <!t>[t]<!/t>red<!t>[/t]<!/t> becomes <!t>[red]<!/t> when posted.

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

    Re: Decimals Display in a Report (2003)

    The attached zipped demo database shows a way to fake it in a form or report. The form frmDemo contains two text boxes. The one on the left shows the unformatted numbers, the one on the right shows a formatted text value, right-aligned. Negative numbers are displayed in red by using conditional formatting. The control source of the text box is
    <code>
    =IIf([Data]>=0,[Data],Format([Data],"Fixed"))
    </code>
    Note that you cannot use the values in the second text box in calculations, since they are text values.
    Attached Files Attached Files

  9. #9
    Star Lounger
    Join Date
    Mar 2001
    Location
    Dudley, Midlands, England
    Posts
    55
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Re: Decimals Display in a Report (2003)

    Thanks, Hans.

    That would work brilliantly well for a report. If I wanted to do the same thing in a form, there wouldn't be any way of doing it while at the same time allowing the formatted text box to be inputable, I'd have to have a separate input box?

    Regards,

    Simon

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

    Re: Decimals Display in a Report (2003)

    No, that is not possible. You cannot enter anything in a calculated control.

Posting Permissions

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