Changing forecolor in selected subform records

J

JKlein

I am looking for a way to highlight certain records showing in a subform.
Something like this

If clientID = "377" then
clientid.forecolor = 255 else
clientid.forecolor = 0
endif

I have placed code like this in the subforms on current event...does not
work.
Any ideas??
 
J

John Vinson

I am looking for a way to highlight certain records showing in a subform.
Something like this

If clientID = "377" then
clientid.forecolor = 255 else
clientid.forecolor = 0
endif

I have placed code like this in the subforms on current event...does not
work.
Any ideas??

What version of Access do you have? If it's 2000 or later, select the
textbox (or textboxes) that you want to change color and select
Format... Conditional Formatting.

John W. Vinson[MVP]
 
J

JKlein

This will work for text but I also have a field that shows a -1 if a
outline is to be displayed so I need to do this the hard way...in code. (If
fld_outline = -1 then outline is visible)
 
J

John Vinson

This will work for text but I also have a field that shows a -1 if a
outline is to be displayed so I need to do this the hard way...in code. (If
fld_outline = -1 then outline is visible)

Just use an Expression in the conditional formatting, rather than just
the value of the field.

John W. Vinson[MVP]
 
J

JKlein

Okay.....I dont think that I can use conditional formatting because I will
need to be saving this as a Access 97 db and it is not available. But I am
curious, Is there a way to control other controls from a text field with
conditional formatting? eg: if text field equals 1 then rectangle is
visible.
 
J

John Vinson

Okay.....I dont think that I can use conditional formatting because I will
need to be saving this as a Access 97 db and it is not available. But I am
curious, Is there a way to control other controls from a text field with
conditional formatting? eg: if text field equals 1 then rectangle is
visible.

Without conditional formatting available, it's a HUGE pain in the
neck. It can be done but for my own A97 apps I decided that it's
simply not worth the implementation and maintenance hassle.

John W. Vinson[MVP]
 
Top