Results 1 to 11 of 11
  1. #1
    Platinum Lounger
    Join Date
    Dec 2001
    Location
    Melbourne, Australia
    Posts
    4,594
    Thanks
    0
    Thanked 27 Times in 27 Posts

    Highlighting controls in a selected record (Access 2003 sp2)

    I have a need to highlight controls in a selected record in a continous form. This form is based upon a union query that shows holidays as well as jobs to be done. i want to highlight the holiday records.

    Any clues?

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Highlighting controls in a selected record (Access 2003 sp2)

    See if one of the sample forms in the database attached to <post:=382,292>post 382,292</post:> helps you on your way. If not, post back with more info.

  3. #3
    Platinum Lounger
    Join Date
    Dec 2001
    Location
    Melbourne, Australia
    Posts
    4,594
    Thanks
    0
    Thanked 27 Times in 27 Posts

    Re: Highlighting controls in a selected record (Access 2003 sp2)

    Thanks Hans, can you tell me how frmProductsCategory2 works? There's no code or macros???

  4. #4
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Highlighting controls in a selected record (Access 2003 sp2)

    In the first place, the text boxes ProductName and Category have their BackStyle property set to Transparent.

    In the second place, there are eight text boxes (as many as there are categories) txtBackground1 through txtBackground8, each of which fills up the entire Detail section. These text boxes have been placed behind ProductName and Category. Their BackStyle property has been set to Transparent too, as well as their BorderStyle.
    The font for these text boxes is set to Terminal (a DOS font that is present on all Windows PCs) and the FontSize to 100. Each of these text boxes has a different ForeColor (i.e. font color): beige for txtBackground1, pale green for txtBackground2, etc.
    The ControlSource property of txtBackground1 has been set to =IIf([CategoryID]=1;String(50;"

  5. #5
    Platinum Lounger
    Join Date
    Dec 2001
    Location
    Melbourne, Australia
    Posts
    4,594
    Thanks
    0
    Thanked 27 Times in 27 Posts

    Re: Highlighting controls in a selected record (Access 2003 sp2)

    Clever, i only noticed txtBackGround8, but also didn't notice any of the other points you have mentioned.

    So if i wanted to adopt a similar schem of 2 conditions, would i have 2 background text boxes?

    Is the 50 fixed?

    Thank you for your detailed explanation.

  6. #6
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Highlighting controls in a selected record (Access 2003 sp2)

    You could use one text box less than there are conditions, since you can use the BackColor of the Detail section itself too. I used 8 boxes for 8 conditions for consistency only.

    The 50 characters are sufficient to fill the width of the form. If you have a narrower form, you could decrease this number, and if your form is wider, you may need to increase it. You can vary the font size too.

  7. #7
    Platinum Lounger
    Join Date
    Dec 2001
    Location
    Melbourne, Australia
    Posts
    4,594
    Thanks
    0
    Thanked 27 Times in 27 Posts

    Re: Highlighting controls in a selected record (Access 2003 sp2)

    Thanks for that, i used 255 as the number of chars and127 as the font size, this almost fills the area i need, but that's good enough.

  8. #8
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Highlighting controls in a selected record (Access 2003 sp2)

    BTW, if you only have a few conditions, you can also use Format | Conditional Formatting...

  9. #9
    Platinum Lounger
    Join Date
    Dec 2001
    Location
    Melbourne, Australia
    Posts
    4,594
    Thanks
    0
    Thanked 27 Times in 27 Posts

    Re: Highlighting controls in a selected record (Access 2003 sp2)

    Would you do that with the transparent text box?

    Or do you apply conditional formatting to all the controls in the detail section?

  10. #10
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Highlighting controls in a selected record (Access 2003 sp2)

    That depends on what you want - if you want a background color, apply conditional formatting to a text box behind all other controls that fills the entire Detail section.
    If you want to highlight individual controls, apply it to them.

  11. #11
    Gold Lounger
    Join Date
    Jun 2001
    Location
    Crystal Beach, FL, Florida, USA
    Posts
    3,436
    Thanks
    1
    Thanked 34 Times in 34 Posts

    Re: Highlighting controls in a selected record (Access 2003 sp2)

    Follow the link below to my website. There is a demo there for how this can be done.
    Mark Liquorman
    See my website for Tips & Downloads and for my Liquorman Utilities.

Posting Permissions

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