Results 1 to 6 of 6
  1. #1
    Join Date
    Aug 2004
    Posts
    364

    Unanswered: Need a Checkbox to change colour of textbox

    If i tick a check box on a form I want the colour of the text boxes containing text to change e.g. from white to yellow.

    Is there a bit of code which will do this in the checkbox event procedure?

    Cheers

    Tom

  2. #2
    Join Date
    Sep 2003
    Location
    MI
    Posts
    3,713
    Quote Originally Posted by moss2076
    If i tick a check box on a form I want the colour of the text boxes containing text to change e.g. from white to yellow.

    Is there a bit of code which will do this in the checkbox event procedure?

    Cheers

    Tom
    Yes ...

    Private Sub CheckBox_Click()

    if CheckBox.Value=True then
    SomeText.ForeColor=12345 ' Or some other color's #
    endif

    End Sub
    Back to Access ... ADO is not the way to go for speed ...

  3. #3
    Join Date
    Aug 2004
    Posts
    364
    That works great, what extra code do I need to change the colour back to the original colour?

    Tom

  4. #4
    Join Date
    Aug 2004
    Posts
    364
    Its ok Ive done it

  5. #5
    Join Date
    Aug 2004
    Posts
    364
    I now need the text box which has changed color to only stay on that color for that record, not all the records in the table.

    What is the code for this?

    Tom

  6. #6
    Join Date
    Sep 2003
    Location
    MI
    Posts
    3,713
    Quote Originally Posted by moss2076
    I now need the text box which has changed color to only stay on that color for that record, not all the records in the table.

    What is the code for this?

    Tom
    Nothing like not providing all the RELEVANT details ... Basically, if this is a continuous forms, you can scrap the previous code and look forward to setting up conditional formatting ...
    Back to Access ... ADO is not the way to go for speed ...

Posting Permissions

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