• Can a checkbox be formatted? (Access 97 SR)

    Home » Forums » AskWoody support » Productivity software by function » MS Access and database help » Can a checkbox be formatted? (Access 97 SR)

    Author
    Topic
    #370641

    I have a continuous form on which the CodeAlert checkbox is checked on an individual record when the Code for that record “W”. The Code is selected from a dropdown. This works fine.

    The user wants the CodeAlert to be red (Border, Fore or BackColor) when it is checked. I do not think Access gives me this ability, but I am hoping I am wrong. Alternately, we can forget the checkbox and have the Code’s Forecolor as red if the Code selected “W”, but when I change the Forecolor on a non-W record, all the codes in the dropdown are red. (not just the non-W’s)

    Can this be done or can someone think of another way to present this concept on a continuous form? Thank you.

    Viewing 0 reply threads
    Author
    Replies
    • #586979

      I don’t think there is any formatting you can do with a checkbox. If you had Access 2000, you could use the Conditional Formatting capability to easily control the formatting (forecolor, backcolor, etc.) of a text control based on a condition.

      In Access 97, there are ways to vary the colors, but it is not easy. To change the forecolor, you can insert a color in the format property, but this only works for certain situations (it works best if you have a True/False field). So, you could add a textbox to your form, and set its recordsource to: =(Code=”W”)

      This way, this new textbox’s value equates to True if Code=”W”, and False if Code”W”. Then set the format property to this:

           ;"Warning"{red};"OK"{black}

      Except, change the curly brackets above to square brackets! When I try to use them, they get interpreted as formatting commands here.

      • #587022

        Thank you, Mark. I put a bright red asterisk in the textbox you suggested when the Code = “W” and it looks pretty good. I was stuck on that checkbox and you came up with a really helpful alternative – much appreciation.

        • #587061

          I’m glad you got what you wanted. One has to be a little creative sometimes to get around Access97 limitations, but it can usually be done one way or another!

    Viewing 0 reply threads
    Reply To: Can a checkbox be formatted? (Access 97 SR)

    You can use BBCodes to format your content.
    Your account can't use all available BBCodes, they will be stripped before saving.

    Your information: