Format control source

  • Thread starter Thread starter Chrissy
  • Start date Start date
C

Chrissy

Hi guys! Please help -- amateur here.

The following is a control source on a report.

=[CName] & " " & IIf([Active]=False,"Inactive")

Is Access able to format the "Inactive" as it can with a control?

I've tried: Format("Inactive","Forecolor=255") to no avail. Undoable or my
code?

Thanks.
 
Hi Chrissy,

Text boxes do not allow for multiple colors. With one exception, in
Access 2007, if it is a rich text format text box you could. It would
involve using the appropriate rich text encoding.

The easier thing to do would be just to place the "Inactive" in a
separate text box and set that text box's foreground to the desired color.

Clifford Bass
 
I was afraid of that. Thanks so much for responding.
--
Chrissy


Clifford Bass said:
Hi Chrissy,

Text boxes do not allow for multiple colors. With one exception, in
Access 2007, if it is a rich text format text box you could. It would
involve using the appropriate rich text encoding.

The easier thing to do would be just to place the "Inactive" in a
separate text box and set that text box's foreground to the desired color.

Clifford Bass

Chrissy said:
Hi guys! Please help -- amateur here.

The following is a control source on a report.

=[CName] & " " & IIf([Active]=False,"Inactive")

Is Access able to format the "Inactive" as it can with a control?

I've tried: Format("Inactive","Forecolor=255") to no avail. Undoable or my
code?

Thanks.
 
Hi Chrissy,

Actually, I just had an untested idea. You might be able to mimic
having two colors. Again, create two text boxes. In one set it to show only
the name, in black. In the other, set it to your current formula, with the
desired foreground color for the whole control. Place the controls exactly
on top of each other. Move the "Inactive" control to the back ("Move To
Back" item on the Arrange menu/ribbon if I recall correctly) so that the
black text will print on top of the colored text.

Good luck,

Clifford Bass
 
Back
Top