tabular form, format each record differently

inspector-71

New member
Local time
Today, 00:21
Joined
Jun 2, 2010
Messages
9
Hi All,

Any help on this one woudl be much appreciated. The picture below probably better explains what I want to do but I'll give it a go in text

I have a tabular form with multiple records
For each record I want to change the fill colour of the "Ass." textbox depending on if there is a name in the "owner" textbox.

As I don't know the formatting command yet, I was trying to do it with zero's and one's to test the code out but I don't seem to be able to get each record displaying differently i.e they are all zero's or one's.

I have been trying to run the code when the form opens.

Any suggestions,

4663761446_0e509af0b9_b.jpg
 
No code required in versions 2000 and later. Look at Format/Conditional Formatting (on the ribbon in 2007 & 2010).
 
In Form Design View
  1. Right click on teh Ass textbox
  2. Click on Conditional Formatting
  3. From Left Drop Down select Expression Is
  4. In box to right enter Not IsNull([Owner])
  5. Now select the green background color using the 'paint bucket' icon
  6. Click on Add
  7. From Left Drop Down select Expression Is
  8. In box to right enter IsNull([Owner])
  9. Now select the red background color using the 'paint bucket' icon
  10. Click on OK
You should be set now. Note that when referring to controls in Conditional Formatting you have to use the format [Owner] including the square brackets.
 
many thanks for the replies. A good reminder not to overlook the obvious routes first!
 

Users who are viewing this thread

Back
Top Bottom