Results 1 to 9 of 9
  1. #1
    Join Date
    Dec 2005
    Posts
    121

    Unanswered: Access 97- I need negative numbers in Red!!

    Help! I can't figure out how to get a report in Access 97 to show negative numbers in Red. Any suggestions?

  2. #2
    Join Date
    Nov 2004
    Location
    Norway
    Posts
    441
    In the format property of the control, try entering something like this

    # ##0.00;[Red]-# ##0.00
    Roy-Vidar

  3. #3
    Join Date
    Dec 2005
    Posts
    121
    Thanks Roy, but I do have one other situation. Previously that field was a Percent field, how do I incorperate that into the format?

  4. #4
    Join Date
    Feb 2004
    Location
    New Zealand
    Posts
    1,418
    Provided Answers: 7
    what I have done in the pass is write a event
    in the Detail On Format

    If Me.Text0 < 0 Then
    Me.Text0.ForeColor = 255
    Else
    Me.Text0.ForeColor = 0
    end if
    hope this help

    See clear as mud


    StePhan McKillen
    the aim is store once, not store multiple times
    Remember... Optimize 'til you die!
    Progaming environment:
    Access based on my own environment: DAO3.6/A97/A2000/A2003/A2007/A2010
    VB based on my own environment: vb6 sp5
    ASP based on my own environment: 5.6
    VB-NET based on my own environment started 2007
    SQL-2005 based on my own environment started 2008
    MYLE
    YOUR PASSWORD IS JUST LIKE YOUR TOOTHBRUSH DON'T SHARE IT.

  5. #5
    Join Date
    Feb 2004
    Location
    Wales
    Posts
    343
    I used a similar code to myle,in some statistical reports I've been required to measure against a target - a deparment sales target for instance is write a event in the Detail On Format like:

    If Me.Textsales < texttarget Then
    Me.Textsales.ForeColor = 255
    Else
    Me.Text0.ForeColor = 0
    end if

    Its useful for the highlighting of specific points

    Gareth

  6. #6
    Join Date
    Mar 2003
    Location
    The Bottom of The Barrel
    Posts
    6,102
    Provided Answers: 1
    Does access 97 not have conditional formatting?
    oh yeah... documentation... I have heard of that.

    *** What Do You Want In The MS Access Forum? ***

  7. #7
    Join Date
    Nov 2004
    Location
    out on a limb
    Posts
    13,692
    Provided Answers: 59
    it may do, but I'd strongly reccommend that they are not used

    personlly I always prefer to put those style rules into the reports on format event, and the users can seelct what ever formatting options they require, heck I've even deployed a report that allowed a users to change the colour of the report functions depending on who the user was. He was colour blind and therefore didin't see the colour changes his immediate boss demanded.

    why?
    they are a pig to maintain, especially if the formatting rules are complex
    they are easy to forget / not see, especially if you are given the report and told the customers requires changes immediately
    they are limited (you only have 4 states / 3 conditions)
    they are a pig to error check (if the formating is in a code block I find it easier to cut and paste and then make changes, and also to "see" where an error exists if the 'flow' of the code looks odd

    but as ever
    yer pays yer money, yer takes yer choice.....
    I'd rather be riding on the Tiger 800 or the Norton

  8. #8
    Join Date
    Nov 2004
    Location
    Norway
    Posts
    441
    a97 doesn't have conditional formatting.

    For percent and usage of the format property, one might try

    0.00 %;[Red]-0.00 %

    For reports, like here, one can use coding in the on format. That isn't available for forms, should that be interesting in a97, where I'm told something like this http://www.mvps.org/access/forms/frm0024.htm might be used.

    In a2k+ versions, I'll recommend usage of conditional formatting where applicable.
    Roy-Vidar

  9. #9
    Join Date
    Dec 2005
    Posts
    121
    This is all great stuff! Thanks to everyone for their input, hopefully some day I can return the favor to all of you with some little bit of information I find out.

    Bob

Posting Permissions

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