Highlight row in Continuous Form

Anonymous
2010-07-02T20:04:43+00:00

I have a continuous form that is quite wide.  When the user is trying to read across, its somewhat hard to follow across.  So, I would like to have the user select the record using the record selector and change the background color of the records in that row or highlight it in some way.  Is this possible?

Microsoft 365 and Office | Access | For home | Windows

Locked Question. This question was migrated from the Microsoft Support Community. You can vote on whether it's helpful, but you can't add comments or replies or follow the question.

0 comments No comments
{count} votes

13 answers

Sort by: Most helpful
  1. Anonymous
    2015-10-28T22:19:45+00:00

    CF = 'conditional formatting' which is part of the built in form design interface.

    Setting the colour is done in the conditional formatting dialogue, not in code.  The expression merely compares the value of the primary key column to the value of the unbound hidden text box to which the value of the primary key of the currently selected row has been assigned in the form's Current event procedure.  Consequently the expression will evaluate to True only for the currently selected row, implementing the conditional formatting to change the colour of the control for that row only.

    0 comments No comments
  2. Anonymous
    2015-10-28T23:30:45+00:00

    Oh...didn't understand where to put the expression but it does work if the form has a primary key.  In my case I have several subforms that are linked but there is a two field combination that makes up the primary key.   As it works now, it only highlights one field and not the entire row.   Any suggestion?

    0 comments No comments
  3. Anonymous
    2015-10-29T13:28:58+00:00

    To highlight the complete row you have two choices: (a) conditionally format each control, or (b) do as Marshall described in his original reply and place an unbound box behind the control and highlight that.  Read Marshall's post carefully for a full description of what else you need to do.

    As regards forms or subforms where the primary key is a composite one then you simply need to put two hidden text boxes in the form/subform and reference both elements of the key in the conditional formatting expression, using a Boolean AND operation.

    0 comments No comments