change four colors on continuous form

A

awu

Hi, All:
I have a continuous form with two text fields. I need to have five
backgroud color's change base on the combination values on these two
field when the form is open. I know there are four color selection on
Format > conditional formating. But it only gives four color choices.
How do I program to change colors on Form_Open event? I read several
threads about color changes on continuous form. They all said there is
no simple way to do it, but they don't give clear answer. Someone can
help me?


Thank you
awu10
 
G

Guest

Hi, From memory I don't think this is possible. Its a bit like changing the
colour of buttons in Access. The property just doesn't exist! I tried some
time ago to do what you want but found I had to write my application in VB to
achieve the desired outcome. Sorry, but unless things have changed in the
last few years I think you might have to think of another way around this
problem.
 
G

Guest

The problem with color changing on continuous forms is that although you will
see multiple occurances of a control, They are, in fact, only once control.
Therefore, any property set for one affects all. So, if you change the color
of Me.txtCustomerName.BackColor = vbRed, then all the customers names on the
form will change to red.

As to chaning in the form Open event, it would be no different than doing it
in any other event. If you are using conditional formatting, it should not
matter, because the conditional formatting is going to take care of it. If
you are wanting to affect the colors programmatically, I would suggest the
form Current event instead. That way, it is executed for each record change,
including the first record loaded.
 
D

david epsom dot com dot au

In 1999 Igor Bezzubikov published a method for coloring
records depending on data. I think it is available here:

http://193.232.194.85/access/Queries/DownloadsList.asp

(look for Records' Colors).

Briefly, he creates a table with different color bitmaps,
then links that table to the data table. All the other
controls on the form are transparent, and the colored
bitmap is displayed behind the other controls. The color
is changed by updating the value of the link field in
each record. Because the bitmap is a bound data value,
it is different for each record in continuos forms.

The other method, which you will see more commonly,
is to create a text box with a different fore color,
and fill the text box with a block character. It is
less flexible because you need another textbox for
each color.

I've never heard anything more from Igor Bezzubikov, but
it was an intelligent and creative piece of programming.
People had been looking for a method of doing this since
Access was first released, and nobody else had found
a solution.

For most people, the extended formatting properties
available in current versions of Access are good enough,
but for cases where multiple colors are required, this
is still the best way.

(david)




'Author of this base-sample Igor Bezzubikov
 

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