Add a text box (named txtKey) to the form's Header section.
Then use the form's Current event to set its value to the
primary key field:
Me.txtKey = Me.yourPKfield
Now you can use the conditional formatting expression
[yourPKfield] = [txtKey]
One thing to you might want to consider as an alternative to
using CF on a bunch of separate text boxes is to add a text
box to the detail section. Make it the same size as the
detail section and use Format menu - Send to Back to put it
behind all the other controls. Then use CF on this text box
and set all(?) the other controls BackStyle to Transparent.
I do understand that I need to use conditional formatting. However, I don't
know what the Expression would be to only colour 1 field (row) at a time
based on the field My Comments having the focus and not the field that I want
to have the colour. Remember that the only field being Enabled/Unlocked is
the My Comments field all others are Locked and Disabled.
liz25mc wrote:
I have various fields that do not get the focus on a continuous form. There
is only 1 field allowed the focus: My Comments.
I want each field in the row to have a background colour when the My
Comments field has the focus.
I would like 1 row to be coloured at a time. Everything I have tried
colours every row because they are continuous forms.
:
You can not use a code procedure to color a control.
Instead, you need to use Conditional Formatting (Format
menu), which allow you to use a default color plus 3
conditional colors for a control.