Conditional Format on Continuous Form

  • Thread starter Thread starter Secret Squirrel
  • Start date Start date
S

Secret Squirrel

I have a subform with 4 records on it. How can I change the backcolor of just
the controls for first 2 records?
 
How do you know which records are the first two? Is there a specific value
associated with the first two?

If it is just the first two records that appear on the form and there is no
specific order then you might be able to write a VBA function that returns
true or false based on the value of the primary keys and then use that in a
conditional format expression to control the backcolor of the controls.



John Spencer
Access MVP 2002-2005, 2007-2009
The Hilltop Institute
University of Maryland Baltimore County
 
Yes there is a specific value associated with those two records. The control
called "RangeID" would = 1.
 
Then you should be able to use the following in conditional formatting for the
relevant controls to determine the back color of the controls.

Expression Is: [NameOfRangeIDField] = 1


John Spencer
Access MVP 2002-2005, 2007-2009
The Hilltop Institute
University of Maryland Baltimore County
 
I actually tried that at first but I want all the controls for those records
to be the same backcolor, not just the RangeID control.

John Spencer said:
Then you should be able to use the following in conditional formatting for the
relevant controls to determine the back color of the controls.

Expression Is: [NameOfRangeIDField] = 1


John Spencer
Access MVP 2002-2005, 2007-2009
The Hilltop Institute
University of Maryland Baltimore County

Secret said:
Yes there is a specific value associated with those two records. The control
called "RangeID" would = 1.
 
Note that John's suggestion was "...for the relevant controls ..."

You will need to set the conditional formatting for *each* control on
your subform, if you want the entire row to have the same background
color.

(The condition for all controls will be the same.)

--
Clif

Secret Squirrel said:
I actually tried that at first but I want all the controls for those
records
to be the same backcolor, not just the RangeID control.

John Spencer said:
Then you should be able to use the following in conditional
formatting for the
relevant controls to determine the back color of the controls.

Expression Is: [NameOfRangeIDField] = 1


John Spencer
Access MVP 2002-2005, 2007-2009
The Hilltop Institute
University of Maryland Baltimore County

Secret said:
Yes there is a specific value associated with those two records.
The control
called "RangeID" would = 1.

:

How do you know which records are the first two? Is there a
specific value
associated with the first two?

If it is just the first two records that appear on the form and
there is no
specific order then you might be able to write a VBA function that
returns
true or false based on the value of the primary keys and then use
that in a
conditional format expression to control the backcolor of the
controls.



John Spencer
Access MVP 2002-2005, 2007-2009
The Hilltop Institute
University of Maryland Baltimore County

Secret Squirrel wrote:
I have a subform with 4 records on it. How can I change the
backcolor of just
the controls for first 2 records?
 
Back
Top