BackColor

  • Thread starter Thread starter Bob
  • Start date Start date
B

Bob

I have a continuous form with a field called Size. I would
like for the backcolor to change based on the value that
is in the field. I do not want to use the Conditional
format within Access (format menu). I have tried to use an
If statement in the forms current property but it changes
the color of all of the fields based on the value of the
first Size field in the form. Example: 4 is supposed to be
blue so if the first record of the form is 4 then all of
the records have a blue backcolor in size regardless of
the value. Thank you in advance.
 
Unbound text boxes on a continuous form behave as multiple
instances of a single object which is why all the size
fields turn blue.

Hope This Helps
Gerald Stanley MCSD
 
Only objects that are bound to the form's recordsource can
change from record to record on a continuous form. That's
why conditional formatting is used. Even that approach is
severely limited since it only distinguishes between zero,
null, positive, and negative numeric values. In short,
what you're describing can't be done on a continuous form.
 
I am not sure if this matters or not but the field is
bound to a field from the forms control source.
 
'Binding' effects ONLY the field's .value property, hence
the 'values' displayed change from record to record. The
backcolor property and other properties are not effected
by binding, so they behave independently.
 
I am not sure if this matters or not but the field is
bound to a field from the forms control source.
 
Elwin you are mistaken in your statement regarding Conditional
Formatting. Perhaps you are still using Access97. A2K or higher has a
fully developed CF method.

--

HTH
Stephen Lebans
http://www.lebans.com
Access Code, Tips and Tricks
Please respond only to the newsgroups so everyone can benefit.
 
lol, no.

It means it doesn't matter that your control is bound, it
still can't be done on an Access form. It would work on a
report though.
 
I'm just curious why you don't want to use Continuous Formatting. It is a
built-in, non-programmatic, easy-to-use solution. You should have seen what
we had to do in Access 97 and before. In fact, you can. On my website is a
small sample database called "ChangingColorFields.mdb" which shows the
hassle that we used to have to go through. Conditional Formatting was sent
from heaven (odd though, that Microsoft was the messenger!)

I also have a sample on my site called "ConditionalFormatting.mdb".
Doubtless Steve's is better, but perhaps a second sample would be helpful.
 
Back
Top