Highlight all other fields on selected row in continuous form,

E

efandango

I have a continuous form that when I click on a field (Run_point_Venue) I
want all the other fields in the selected row to highlight with a background
color.

If at all possible, I would like the selected field to not have to change
background color, just the rest of the fields. That way, the user can see
which field he selected, and still have the whole row highlighted.


Form: frm_Points

Fields:
Run_point_Venue (Selected Field)
txt_Getrounds_Present_Flag
LeaveBy1_ID_Combo
LeaveBy2_ID_Combo
LeaveBy3_ID_Combo
LeaveBy4_ID_Combo
 
M

Marshall Barton

efandango said:
I have a continuous form that when I click on a field (Run_point_Venue) I
want all the other fields in the selected row to highlight with a background
color.

If at all possible, I would like the selected field to not have to change
background color, just the rest of the fields. That way, the user can see
which field he selected, and still have the whole row highlighted.


Form: frm_Points

Fields:
Run_point_Venue (Selected Field)
txt_Getrounds_Present_Flag
LeaveBy1_ID_Combo
LeaveBy2_ID_Combo
LeaveBy3_ID_Combo
LeaveBy4_ID_Combo


The first thing you would need is a hidden text box (named
txtKey) and a line of code in the form's Current event:
Me.txtKey = Me.[primary key field]
This can then be used to determine the active record.

Then you could use Conditional Formatting (Format menu) with
two levels on each text box in the detail section. The
first CF level would use an expression like:
[primary key field] = [txtKey]
and set the back color to the highlights color. The second
level would use the Has Focus option with your normal back
color.

I think that's kind of tedious and may have a noticeable
performance effect. I would first experiment with a
different approach by adding a text box that is the same
size as the entire detail section. Set its Locked property
to Yes and Enabled to No so it won't react if a user clicks
on it. Use CF with the expression:
[primary key field] = [txtKey]
and back color set to the highlight color. Use Format -
Send to Back to put it behind all the other controls.

Then set all the other text boxes BackStyle property to
Transparent. The big text box's color will show through all
the text boxes except the one with the focus. The control
with the focus will be displayed with it's own (normal) back
color.
 
E

efandango

Thanks Marsh,

As you rightly say, the first option introduces too much overhead (of an
already heavyweight database, forms, tabs, etc).

The second option works better, but is not entirely ideal, in that my field
boxes are spaced horizontally, and the txtkey box displays too many
horizontal bars down the form, of what was a nice clean looking form. In
particular where the bar runs between the spaced field boxes doesn't look
very nice. But hey, we can't have everything, right...

thanks all the same.

regards

Eric


Marshall Barton said:
efandango said:
I have a continuous form that when I click on a field (Run_point_Venue) I
want all the other fields in the selected row to highlight with a background
color.

If at all possible, I would like the selected field to not have to change
background color, just the rest of the fields. That way, the user can see
which field he selected, and still have the whole row highlighted.


Form: frm_Points

Fields:
Run_point_Venue (Selected Field)
txt_Getrounds_Present_Flag
LeaveBy1_ID_Combo
LeaveBy2_ID_Combo
LeaveBy3_ID_Combo
LeaveBy4_ID_Combo


The first thing you would need is a hidden text box (named
txtKey) and a line of code in the form's Current event:
Me.txtKey = Me.[primary key field]
This can then be used to determine the active record.

Then you could use Conditional Formatting (Format menu) with
two levels on each text box in the detail section. The
first CF level would use an expression like:
[primary key field] = [txtKey]
and set the back color to the highlights color. The second
level would use the Has Focus option with your normal back
color.

I think that's kind of tedious and may have a noticeable
performance effect. I would first experiment with a
different approach by adding a text box that is the same
size as the entire detail section. Set its Locked property
to Yes and Enabled to No so it won't react if a user clicks
on it. Use CF with the expression:
[primary key field] = [txtKey]
and back color set to the highlight color. Use Format -
Send to Back to put it behind all the other controls.

Then set all the other text boxes BackStyle property to
Transparent. The big text box's color will show through all
the text boxes except the one with the focus. The control
with the focus will be displayed with it's own (normal) back
color.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top