Results 1 to 11 of 11
  1. #1
    accessnewbie352 is offline Advanced Beginner
    Windows 7 32bit Access 2010 32bit
    Join Date
    Jan 2015
    Posts
    46

    Changing Formatting of Text Values - Accounting Format

    I am trying to change the values in a text box to show (###) if negative. For example, change -90 to (90)


    Is there a way to do this - in property form maybe?

  2. #2
    June7's Avatar
    June7 is online now VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,930
    Bing: access database negative parentheses

    Review http://www.access-programmers.co.uk/...ad.php?t=89910
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  3. #3
    accessnewbie352 is offline Advanced Beginner
    Windows 7 32bit Access 2010 32bit
    Join Date
    Jan 2015
    Posts
    46
    Thank you @June7 - that worked, however now something has happened with my formatting where the values in the top row do not match the values from the other rows (they are all from the same field).

    I want the values to be displaced in Standard view, with no decimals.

    In the property sheet, i have set:
    Format : Standard
    Decimal: 0

    This seems to work for all of the values except the top row for some reason.

  4. #4
    June7's Avatar
    June7 is online now VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,930
    If you are using the suggested formatting, why would it show "Standard"?

    Remove .00 from the format if you don't want decimals.

    I don't understand 'do not match'. By top row you mean the first record?
    Last edited by June7; 01-09-2015 at 06:36 PM.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  5. #5
    Rawb is offline Expert
    Windows 7 64bit Access 2010 32bit
    Join Date
    Dec 2009
    Location
    Somewhere
    Posts
    875
    Are you using the Format() function at all? If you use the Format() function on a numeric value, it gets converted to a text string and, as text, no longer follows any numeric formatting requirements set (such as the Format or Decimal properties of a text box)

    In a situation like this - where the formatting is should be controlled by the Form, it's better to use Round(). If, for some reason, you have to use Format(), then you can convert it BACK to a numeric type with CDbl() (or CLng() since you don't want decimals to display).

    Code:
    Format(1.59, "#,##0") ' Displays the STRING value "2"
    CDbl(Format(1.59, "#,##0")) ' Displays the NUMERIC value 2
    CLng(1.59) ' Displays the NUMERIC value 2
    Round(1.59, 0) ' Displays the NUMERIC value 2

  6. #6
    accessnewbie352 is offline Advanced Beginner
    Windows 7 32bit Access 2010 32bit
    Join Date
    Jan 2015
    Posts
    46
    Yes, top record. The formatting for the others are fine but the first record does not follow the formatting for some reason.

  7. #7
    accessnewbie352 is offline Advanced Beginner
    Windows 7 32bit Access 2010 32bit
    Join Date
    Jan 2015
    Posts
    46
    I'm just formatting using the Property Sheet - I'm not that familiar with codes. For the parenthesis around the values, i have using: =IIf([Pool Delta]<0,"(" & [Pool Delta] & ")",[Pool Delta])

  8. #8
    June7's Avatar
    June7 is online now VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,930
    I used $#.00;($#.00 [Red]) in Format property and it works for all records.

    Cannot replicate the issue.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  9. #9
    accessnewbie352 is offline Advanced Beginner
    Windows 7 32bit Access 2010 32bit
    Join Date
    Jan 2015
    Posts
    46
    This worked thank you but in terms of the red and the parenthesis but the first row's value still remains the same (although the text turned red).

  10. #10
    accessnewbie352 is offline Advanced Beginner
    Windows 7 32bit Access 2010 32bit
    Join Date
    Jan 2015
    Posts
    46
    Actually, upon closer inspection, it turned everything red with parenthesis, regardless of the values being positive or negative.

  11. #11
    June7's Avatar
    June7 is online now VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,930
    Still cannot replicate the issue.

    If you want to provide db, follow instructions at bottom of my post.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 7
    Last Post: 03-03-2014, 01:36 PM
  2. Replies: 0
    Last Post: 03-11-2013, 07:57 PM
  3. Replies: 1
    Last Post: 12-14-2010, 10:03 PM
  4. Query changing format
    By John Southern in forum Queries
    Replies: 3
    Last Post: 07-05-2010, 09:57 AM
  5. Replies: 3
    Last Post: 08-11-2009, 10:40 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums