Results 1 to 4 of 4
  1. #1
    Join Date
    Jan 2007
    Posts
    4

    Unanswered: Using Got focus to set color

    How do I use GOTFOCUS to have a field turn color when I click or tab to it?

    I want to click on a field in a form then that field turns yellow to indicate that that field is the one selected for data input.

  2. #2
    Join Date
    Jun 2005
    Location
    Richmond, Virginia USA
    Posts
    2,763
    Provided Answers: 19
    To set the field to yellow when it gets focus
    Code:
    Private Sub YourField_GotFocus()
       YourField.BackColor = vbYellow
    End Sub
    Then to set it back when it loses focus
    Code:
    Private Sub YourField_LostFocus()
       YourField.BackColor = vbWhite
    End Sub
    Last edited by Missinglinq; 01-08-07 at 00:28.
    Hope this helps!

    The problem with making anything foolproof...is that fools are so darn ingenious!

    All posts/responses based on Access 2003/2007

  3. #3
    Join Date
    Jan 2007
    Posts
    4

    Thumbs up Great job! Thanks

    Great job! Thanks! It works.
    I have been posting on different forums for the past month and no one could tell me how to do this. I am now in the right place.

  4. #4
    Join Date
    Jun 2005
    Location
    Richmond, Virginia USA
    Posts
    2,763
    Provided Answers: 19
    Glad to help!
    Hope this helps!

    The problem with making anything foolproof...is that fools are so darn ingenious!

    All posts/responses based on Access 2003/2007

Posting Permissions

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