Results 1 to 7 of 7
  1. #1
    Join Date
    Apr 2005
    Posts
    28

    Unanswered: Changing the colour of specific rows in a datasheet

    I have built a form that displays a query in datasheet view. Please see attached .jpg. One of the fields is Stock Category giving you the following options:

    Internal Use
    Sold
    Exhibition
    Demo

    I would like the text or cell colour of the row to change colour depending on Stock Category selected. eg. Sold items would be displayed in red, Internal Use in black

    Is this possible? If so how? My knowledge of VB Code is limited so the more detail the better!

    Look forward to hearing from you

    Kind Regards
    John
    Attached Thumbnails Attached Thumbnails Access.JPG  

  2. #2
    Join Date
    May 2005
    Location
    Nevada, USA
    Posts
    2,888
    Provided Answers: 6
    Presuming you have A2k or later, Conditional Formatting would be the easiest way to achieve what you're after. More info available in Help.
    Paul

  3. #3
    Join Date
    Apr 2005
    Posts
    28
    Brilliant, didn't realise it was that easy!

    Ok from the .jpg you can see that I have quite a few fields. If StockCategory shows "SOLD" how do I get StockType to display in red? What is the expression I can use?

    Many Thanks
    John

  4. #4
    Join Date
    Nov 2004
    Location
    out on a limb
    Posts
    13,692
    Provided Answers: 59
    did you actually try conditional formatting to see what it could do for you?

    incidentally I would try to get away from using datasheets for data entry - you are very limited in what you cna do and its easy to make inadvertant errors in the data (such as changing the wrong row(s),

  5. #5
    Join Date
    May 2005
    Location
    Nevada, USA
    Posts
    2,888
    Provided Answers: 6
    Change the first field to "Expression is" and then put

    [StockCategory] = "SOLD"

    in the second field
    Paul

  6. #6
    Join Date
    Apr 2005
    Posts
    28
    Thanks for all your help! Working perfectly!

    John

  7. #7
    Join Date
    Dec 2003
    Location
    Dallas, TX
    Posts
    1,004

    Talking

    Quote Originally Posted by pbaldy
    Change the first field to "Expression is" and then put

    [StockCategory] = "SOLD"

    in the second field
    Hey Paul and Happy New Year to ya.... It's been a while and hope all is well with you.

    take care
    BUD

Posting Permissions

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