Highlight selected record on continuous form

M

M Skabialka

I have a main form with a combo to select an item, then after update the
record selector on the continuous subrecord is chosen.
I would like to color each field on that record so that it is more obvious
which record is selected.
I need the same formatting if the user selects the record using the record
selector to the left.
I have done this before but can't figure out which database or form I did it
in.

Everything I have tried changes every record, not the selected one...
Mich
 
M

M Skabialka

When I used the combo the conditional formatting worked, when I selected the
record it didn't. So I did as you suggested and for a test changed just one
of the fields on the subform to look at the ID on the same form, and somehow
that has triggered the other fields to correctly show the conditional format
comparing the ID to the ID on the main form. If I remove it from that
field, it stops working --- strange!
Thanks,
Mich

ErezM via AccessMonster.com said:
it's a bit tricky

this example assumes every record has a unique key field (in this case a
long
- which is good for Autonumbers as well) which is called recID

add an unBound hidden textbox at the form's header section (txtRecID)
now use the form's Current Event to:
txtRecID=recID (the key value of the current record)

now, back in the design view of the form, add a conditional-formatting
codition to each control you want to paint when the row is current and set
the condition to:

type of condition: When codition is true,
argument1:
[recID]=[txtRecID]

and choose the back color (or forecolor)

now the current row will be painted differently from all other rows

good luck



M said:
I have a main form with a combo to select an item, then after update the
record selector on the continuous subrecord is chosen.
I would like to color each field on that record so that it is more obvious
which record is selected.
I need the same formatting if the user selects the record using the record
selector to the left.
I have done this before but can't figure out which database or form I did
it
in.

Everything I have tried changes every record, not the selected one...
Mich
 

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