Color UserForm Textbox Based On CheckBox

  • Hi,
    I am working on a form and I would like to know how to have a textboxes colour be determined by a checkbox.
    I would like it to be grey unless the checkbox is checked, then I would like for it to be white.
    Any help would be great.
    This is also my first post so forgive me for my format.[hr]*[/hr] Auto Merged Post Until 24 Hrs Passes;[dl]*[/dl]I forgot to mention that I am using a userform as well.

  • Re: Colour Textbox


    Assuming your userform is called userform1, the textbox is called textbox1 and the checkbox is called checkbox1 then you'll need something like this in the code section of the userform which will fire any time the checkbox value is changed;



    Using the Locked and Enabled properties you could also stop users from beinmg able to alter the contents of the textbox.


    Hope that's useful,
    Ian

  • Re: Colour Textbox


    Welcome to ozgrid


    [FONT="Arial Black"][COLOR="blue"][SIZE="4"]Bill[/SIZE][/COLOR][/FONT]
    Tip: To avoid chasing code always use Option Explicit.

  • If you wish to continue using this free service.


    Please be considerate of others who use the forum for searching. Your current Thread Title (which I will change) is non-reflective of your immediate problem.


    In future, please take 1 minute of your time to read the text on the New Thread page.


    [fa]*[/fa]


    REMEMBER: Your thread title should NEVER be what you THINK is your answer. 9 times out 10 it will wrong and prevent someone from finding a solution to a simliar issue.

Participate now!

Don’t have an account yet? Register yourself now and be a part of our community!