conditional formatting?

hi there

Registered User.
Local time
Today, 01:04
Joined
Sep 5, 2002
Messages
171
hi everyone,

i'm working with an Access 97 application and would like to use conditional formatting for a few controls (text boxes) in my form based on a selection from a combo box on the same form. i know how to do this in XP using the conditional formatting property, but i'm totally lost in Access 97. can you only do this with VBA? if so could some help me with the code. i'm thinking i have to change the BackColor property of the control based on the combo box selection. just a little background:

A. my table is tblDailyLog
B. this table is composed of roughly 20 fields: field1,field2,..field20
C. this table includes a lookup field that has 2 options:
day shift, night shift
D. i've built a query using this table. this query is the
recordsource for my form.
E. i only need to apply this conditional formatting to 12 fields on
the form.

thanks everyone.
 
Your syntax will be something like this

Me!field1.BackColor = 8623747
Me!field2.BackColor = 8623747
etc...

8623747 is a green.

When I don't like the color I'm using, I go to a field on a form, click on the ... button beside the Back Color property. This opens the color picker box. I find the color I like then close the color picker.
The Back Color property box will now have the new color code number.

Tom
 
thanks wizcow. that worked perfectly. although i didn't include any error handling because i'm still pretty green when it comes to VBA. do you have any suggestions on recommended error handling associated with conditional formatting?

thanks again
 

Users who are viewing this thread

Back
Top Bottom