Results 1 to 9 of 9
  1. #1
    5 Star Lounger
    Join Date
    May 2001
    Location
    Patterson Lakes, Melbourne, Victoria, Australia
    Posts
    637
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Background colors (Access 2000 SP2)

    In Access 2000. I have an unbound form with a grid of textboxes 7 x 16 = 112 controls to show data, plus 10 or so other buttons combos etc.
    Problem I want each cell
    Regards,
    Peter

  2. #2
    stevepaul
    Guest

    Re: Background colors (Access 2000 SP2)

    I have an example db that may help but even zipped it is too large to post here, if you want to drop me your email address I will send it to you. stevepaul68@hotmail.com

    Steve Paul

  3. #3
    Super Moderator
    Join Date
    Aug 2001
    Location
    Evergreen, CO, USA
    Posts
    6,623
    Thanks
    3
    Thanked 60 Times in 60 Posts

    Re: Background colors (Access 2000 SP2)

    I'm afraid you will have to resort to code to do what you want - but it will give you the flexibility to do 9 or more values if you so choose. Essentially, an event procedure from "on current" should do the trick, and you would need to loop through all the text boxes and set the color based on the value in the text box. Since you are using an unbound form already, how are the values of the text boxes being set?
    Wendell

  4. #4
    5 Star Lounger
    Join Date
    May 2001
    Location
    Patterson Lakes, Melbourne, Victoria, Australia
    Posts
    637
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Background colors (Access 2000 SP2)

    Sorry Wendell, it's ages since I created this form, and I'm faced with this task. I had assumed it was unbound. It's not! It's a bound form from a Xtab query. 8 fields on a continuous form. the Xtab outputs 16 records. so I guess this is probably unsolvable!
    However, if you do have a solution, it would be very much appreciated.
    Regards,
    Peter

  5. #5
    Super Moderator
    Join Date
    Aug 2001
    Location
    Evergreen, CO, USA
    Posts
    6,623
    Thanks
    3
    Thanked 60 Times in 60 Posts

    Re: Background colors (Access 2000 SP2)

    Actually, I don't think this is unsolvable. Even if it's bound you should be able to loop through the various text boxes and change the background color based on the value of the form. The code should be fired by the "On Current" event. The fact that it is using a Xtab query as it's data source shouldn't hamper you as best I can tell. I would be curious to know how you fare with it.
    Wendell

  6. #6
    5 Star Lounger
    Join Date
    May 2001
    Location
    Patterson Lakes, Melbourne, Victoria, Australia
    Posts
    637
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Background colors (Access 2000 SP2)

    Yeah, but once you change the color of a field, it changes for that field in every record on the form. I have 16 records visible at once in a continuous form. This is why I think it is unsolvable.
    regards
    Regards,
    Peter

  7. #7
    Plutonium Lounger
    Join Date
    Dec 2000
    Location
    Sacramento, California, USA
    Posts
    16,775
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: Background colors (Access 2000 SP2)

    If you had mentioned that first, we could have saved a lot of time. The problem with continuous forms is that you only really see one set of controls at a time, so when you change the color of a control, you see that color change in every record on the screen.
    Charlotte

  8. #8
    Super Moderator
    Join Date
    Aug 2001
    Location
    Evergreen, CO, USA
    Posts
    6,623
    Thanks
    3
    Thanked 60 Times in 60 Posts

    Re: Background colors (Access 2000 SP2)

    Well, being a never say die kind of guy, you are correct about it being unsolvable that way - BUT...
    An approach that would be lots of work, not to mention being somewhat fragile, would be to load the results of your crosstab into an array and then populate the text boxes and set the colors based on the values in the array. There are some limitations on what you can do with crosstab queries, but I believe you should be able to work with the values it returns as a recordset and populate an unbound form. Not pretty, and not for the faint of heart!
    Wendell

  9. #9
    5 Star Lounger
    Join Date
    May 2001
    Location
    Patterson Lakes, Melbourne, Victoria, Australia
    Posts
    637
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: B'ground colors S O L U T I O N F O U N D

    Just goes to show what a phenomenal resource Woody
    Regards,
    Peter

Posting Permissions

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