Yes/No field custom format text color

D

David K.

I am using Access 2007.

I have created a custom Yes/No field in a table by setting the DataType to
Text and then inserting a combo-box in my form. I have set it up to have
OPEN & CLOSED as the choices. My question is if it is possible to have OPEN
be displayed in the color Red and CLOSED displayed in Blue?

My combo-box in my form has these properties:

Control Source: OpenClosed (text field in my table)
Row Source: -1;"OPEN";0;"CLOSED"
Row Source Type: Value List
Bound Column: 1
Format: ;"OPEN"[Red];"CLOSED"[Blue]
Column Count: 2
Column Widths: 0";0.75"

I thought that having the format (in my form) set to
;"OPEN"[Red];"CLOSED"[Blue] would work but both OPEN & CLOSED are displayed
in black. Any suggestions?

Thanks.
 
D

David K.

Thanks, Dirk. I set the OpenClosed field in my table to Text because the
help file within Access explained that was how to create a custom Yes/No
field. Perhaps I misinterpreted the instructions. I'll look into it. This
isn't a critical thing. Just trying to add some minor bells and whistles.
Thanks again.

-David K.

Dirk Goldgar said:
David K. said:
I am using Access 2007.

I have created a custom Yes/No field in a table by setting the DataType to
Text and then inserting a combo-box in my form. I have set it up to have
OPEN & CLOSED as the choices. My question is if it is possible to have
OPEN
be displayed in the color Red and CLOSED displayed in Blue?

My combo-box in my form has these properties:

Control Source: OpenClosed (text field in my table)
Row Source: -1;"OPEN";0;"CLOSED"
Row Source Type: Value List
Bound Column: 1
Format: ;"OPEN"[Red];"CLOSED"[Blue]
Column Count: 2
Column Widths: 0";0.75"

I thought that having the format (in my form) set to
;"OPEN"[Red];"CLOSED"[Blue] would work but both OPEN & CLOSED are
displayed
in black. Any suggestions?


I don't think that works with combo boxes; only text boxes. Also, your
combo box is storing a numeric value -- 0 or -1 -- so it doesn't really make
sense for your table's OpenClosed field to be text. Integer would be a more
likely choice, if you want to allow it to hold Null values. But as I said,
I don't think this type of Format property will work with a combo box,
because combo boxes display values from their lists, not by formatting.

You could do it with conditional formatting, though.

--
Dirk Goldgar, MS Access MVP
www.datagnostics.com

(please reply to the newsgroup)
 

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

Top