Results 1 to 9 of 9
  1. #1
    Join Date
    Nov 2004
    Posts
    64

    Unanswered: Change color of text in a text box

    On a continious form how can I change the color of text to Red in a text box if the value is less than 500 and blue if the text is greater than 500. The form is populated via a query

    Peter

  2. #2
    Join Date
    Nov 2004
    Location
    out on a limb
    Posts
    13,692
    Provided Answers: 59
    if you are using continuous forms then probably your only solution is conditional formatting

    if you are using single forms then you could use some code in the forms on current and control(s) on change events

    HTH

  3. #3
    Join Date
    Nov 2004
    Posts
    64
    Thanks Healdem
    Where do I do the Conditional Formatting? could you explain how i go about doing it.

    Thanks

    Peter

  4. #4
    Join Date
    Mar 2003
    Location
    The Bottom of The Barrel
    Posts
    6,102
    Provided Answers: 1
    I know this sounds like I'm coming from left field, but have you considered typing Conditional Formatting into the help system?
    oh yeah... documentation... I have heard of that.

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

  5. #5
    Join Date
    Sep 2003
    Location
    MI
    Posts
    3,713
    Quote Originally Posted by Teddy
    I know this sounds like I'm coming from left field, but have you considered typing Conditional Formatting into the help system?
    But how do you get help Teddy????? Don't you just love these questions ...
    Back to Access ... ADO is not the way to go for speed ...

  6. #6
    Join Date
    Mar 2003
    Location
    The Bottom of The Barrel
    Posts
    6,102
    Provided Answers: 1
    ah yes....

    "F1, it's not just for speed junkies anymore!"
    oh yeah... documentation... I have heard of that.

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

  7. #7
    Join Date
    Apr 2004
    Location
    outside the rim
    Posts
    1,011

    Talking

    You know, just to be a pain, here’s a different way to do it:

    Put the data source in a hidden control, I’ll call it [txtData]. Place 2 controls on top of each other (make sure the backstyle is transparent) and call then [txtRed] and [txtBlue].

    The control source for [txtRed]: =Iif([txtData]<500,[txtData],””) and for [txtBlue]: =Iif([txtData]<500,””,[txtData])


    and, ummm, where's the F1 key?

    tc
    Last edited by tcace; 11-21-05 at 10:06.

  8. #8
    Join Date
    Nov 2004
    Location
    out on a limb
    Posts
    13,692
    Provided Answers: 59
    shoudl work, provding you are using single forms, suspect will fall aprat if using continuous forms. Also its a nasty way of doing it - if this solution was applied, then the designer is going to hit Accesses resource limits very very quickly (by duplicating the number of controls). And thats a very effective way of bringing any system to its knees.

  9. #9
    Join Date
    Apr 2004
    Location
    outside the rim
    Posts
    1,011
    a very effective way of bringing any system to its knees
    Actually, it works like a champ in continuous forms (the reason I first used it long, long ago in Access 97 which has fewer tools than modern day Access) and reports. I've had no problems with it - have you tired it and found it to cause problems?
    by duplicating the number of controls
    I have some forms with literally hundreds of controls and agin have not had problems.

    It is no different then having a mark, such as an *, appear next to the values that meet a specific criteria (such as when the sum of planned quantity and order quantity fall short of purchase quantity). Conditional VALUES are used in queries all the time - which is actually worse on system resources than this technique since Access only needs to handle one screen of data at a time in a form.

    And I never said this was the best way - simply another way.

    tc

Posting Permissions

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