Display Conditional Font Color in Query

X

Xavier

Hello,

I'm working with crosstab queries to do some counts. I was wondering
how I can get a crosstab query to display the font color in Blue when
the count is 0 or Red when the count is greater than 0. I've read
that this is not possible directly in a query, but I've been working
with a former employee's database and he/she created crosstab queries
that do just this, but I can't figure out how it was done. I can move
the crosstab query into any access database, delete the SQL statement,
and create a brand new query and have my counts display Blue when 0
and Red when >0. It's some property that I can't seem to find.
Anyways, I want to generate my queries through VB code instead so I
was wondering if anyone knew exactly how to do this or if I can code
it so that my query displays the conditional font colors without
putting it in a form or report. Thank you!

Xavier
 
J

John Spencer

I'm not sure this works with a crosstab query, but the query may be
using the format property of the field.

Numbers can be formatted to display in color (limited to 8 pre-defined
colors to show positive numbers, negative numbers, and zero in different
colors.

In the format property of the column, you should see something like

0 [Red];0[Yellow];0[Green]
 

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