Continuous Forms

  • Thread starter Thread starter Justin Mills
  • Start date Start date
J

Justin Mills

I have a continuous form, and I want to have different
background colours depending on a curtian field.

ie: if field Data1 = Yes then the background for that data
panel (not sure of the correct wording for it) will be red,
but if it equals No then it will be green.

Any help would be greatly aprecaited!!

Justin.
 
Justin,

If you are using Access 2000 or later, you can use Conditional
Formatting for this. However, if you want the colour change to apply
to the section, you have to "trick" Access by putting a textbox, bound
to the Data1 field (i.e. this is its ControlSource), to cover the
whole of the form's detail section, and then put it behind the other
data controls via the Format|SendToBack menu. Also, set its Enabled
property to No and Locked to Yes. OK, now select this textbox in form
design, go to Conditional Formatting under the Format menu, and set 2
conditions. The first one is "Field Value is" "equal to" "0" and then
set both the background colour and the font colour to green. And then
"Field Value is" "not equal to" "0" and set both the background colour
and the font colour to red. Hoho, Merry Christmas.
(Note, this assumes Data1 is a Yes/No data type field.)

- Steve Schapel, Microsoft Access MVP
 
thanx for that!

doesn't do quite what i want, cont. formating doesn't show
for a Yes/No field, also, doesn't seem to have an option
for the form back ground colour to change, only, text box
background colour to change.

there must be a way of doing via VBA, but have tried a few
things, and it will change the background for all the
panels/sections, but not seperate ones
 
Just make a large long text box the length of the detail section, and send
it to "back"/behind the current detail section. You then simply use
conditional formatting to set the color of this long text box. If you take a
look at he following screen shots, you can see that I used the above idea to
make "bands of shading" example in the following:

Check out:

http://www.attcanada.net/~kallal.msn/Articles/Grid.htm
 
Please carefully read my earlier post (all of it, looks like you have
only got to the first sentence so far), and follow the suggestions
made.

- Steve Schapel, Microsoft Access MVP
 
Back
Top