Results 1 to 6 of 6
  1. #1
    Join Date
    Jun 2014
    Location
    In a deep fog...
    Posts
    11

    Unanswered: Highlight checkbox on got focus

    Greetings,

    I'm new to this forum, but have been lurking for awhile. I have a tabular form that has text boxes and checkboxes with each record in a row. I have all the text boxes set up with conditional formatting so that when the control has focus, the background colour changes to blue. However, I cannot use conditional formatting for the checkboxes. The users are older and find it hard to see where they are on the record when the focus goes to the checkboxes.

    Is there some VBA code to highlight the actual checkbox when the user tabs into it?

    I tried using a box behind the checkbox, but that affects all records. I need to just highlight the checkbox in the current record.

    btw, I'm using Access 2010.

    Thanks
    Last edited by Tinpusher; 06-19-14 at 19:14.

  2. #2
    Join Date
    Mar 2009
    Posts
    5,442
    Provided Answers: 14
    When you use a form in datasheet or continuous view, the only way to modify the appearance of a control in a row consists in using the conditional formatting features. There is no alternative in Access.
    Have a nice day!

  3. #3
    Join Date
    Jun 2005
    Location
    Richmond, Virginia USA
    Posts
    2,763
    Provided Answers: 19
    Only workaround I can think of would be to
    • Use a Continuous View Form (it can be tweaked to look like a Datasheet View Form, if need be)
    • Replace your Checkbox with a Combobox, with the choices of Yes or No.
    • Use code in the GotFocus event to drop the Combobox list down, making it obvious that it has the Focus:

    Code:
    Private Sub YesNoCombo_GotFocus()
     YesNoCombo.Dropdown
    End Sub

    You can then bind the Combobox to the YesNo Field in the underlying Table.

    Linq ;0)>
    Hope this helps!

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

    All posts/responses based on Access 2003/2007

  4. #4
    Join Date
    Jun 2014
    Location
    In a deep fog...
    Posts
    11
    Sinndho - thanks, I was afraid that would be the answer. ;-)

    Linq - your solution intrigues me. I will build the new form in a little while and give it a try. Quick question - you say to link the combo box with the underlying table. Will I have to change the properties in the table to a combo box or just have the form have the combo box limiting the options to yes/no and that will "check" the checkbox appropriately?

    Thanks

  5. #5
    Join Date
    Mar 2009
    Posts
    5,442
    Provided Answers: 14
    Sorry to be the bearer of bad news
    Have a nice day!

  6. #6
    Join Date
    Jun 2005
    Location
    Richmond, Virginia USA
    Posts
    2,763
    Provided Answers: 19
    Quote Originally Posted by Tinpusher View Post

    ...or just have the form have the combo box limiting the options to yes/no and that will "check" the checkbox appropriately...
    Yes, the Combobox can have its Control Source set to the Yes/No Field in the Table, and it will 'check' the Field in the Table, when you make the selection from the Combobox.

    Linq ;0)>
    Hope this helps!

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

    All posts/responses based on Access 2003/2007

Tags for this Thread

Posting Permissions

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