Changing forecolor in selected subform records

  • Thread starter Thread starter JKlein
  • Start date Start date
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??
 
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]
 
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)
 
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]
 
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.
 
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]
 

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

Back
Top