Adding Color, Bold Etc. To Query Results

Q

quirkyjoe

I was working with a Yes/No field in my query and happened upon this
custom format in the ACCESS help menu:

;"Yes"[Blue];"NO"[Red]

What it does is change the yes/true/on value to "Yes" and colors it
blue and the no/false/off value to "NO" and colors it red when I run
my query.

What I want to know is the basics of how to use this font changing
gizmo in other areas of access. I am assuming the backets tell it to
color it red or blue. Can i make the text bold, italic, etc? How do
I do that? What is the basic function or rule for making these type
of font changes?

Thanks.
 
D

Douglas J. Steele

Colour is the only thing you can change using the Format statement. There's
no way to change font characteristics.

I think there might be slightly more capabilities available in Access 2007.
 
N

Nikos Yannacopoulos

Joe,

In Access, queries are meant for collecting and filtering data, not for
presenting them! As such, queries basically do not offer formatting
options. If you are interested in presenting query results in a certain
way, then you need to create a report based on the query, in which you
can add all formatting you like, and more (such as grouping, totals/
partial totals, line numbering etc.).

HTH,
Nikos
 
A

ashg657

There are a number of ways in access you can replicate this action. For
instance, you could use Conditional Formatting which is available through the
menu's when in design view of a report or form (Format - Conditional
Formatting). This will enable you to change font colour, background colour,
italics, bold, underline if certain conditions specified by yourself are met.
Also you can change the font using the Visual Basic editor. For example on a
form you might when a button is clicked want a font colour to be changed from
red to blue, so you would type the following code OnClick event procedure of
that button:

YourLabel.ForeColor = Red

or....if you wanted to change font to italics...

YourLabel.FontItalic = True

Hope that helps.
Don't forget to rate me as helpful if I have helped you!
 
D

Douglas J. Steele

That's true, but remember that it needs to be done on a form, not in a
query.

(Of course, as Nikos pointed out, he shouldn't be working directly with
queries anyhow)

--
Doug Steele, Microsoft Access MVP

(no e-mails, please!)


ashg657 said:
There are a number of ways in access you can replicate this action. For
instance, you could use Conditional Formatting which is available through
the
menu's when in design view of a report or form (Format - Conditional
Formatting). This will enable you to change font colour, background
colour,
italics, bold, underline if certain conditions specified by yourself are
met.
Also you can change the font using the Visual Basic editor. For example on
a
form you might when a button is clicked want a font colour to be changed
from
red to blue, so you would type the following code OnClick event procedure
of
that button:

YourLabel.ForeColor = Red

or....if you wanted to change font to italics...

YourLabel.FontItalic = True

Hope that helps.
Don't forget to rate me as helpful if I have helped you!

quirkyjoe said:
I was working with a Yes/No field in my query and happened upon this
custom format in the ACCESS help menu:

;"Yes"[Blue];"NO"[Red]

What it does is change the yes/true/on value to "Yes" and colors it
blue and the no/false/off value to "NO" and colors it red when I run
my query.

What I want to know is the basics of how to use this font changing
gizmo in other areas of access. I am assuming the backets tell it to
color it red or blue. Can i make the text bold, italic, etc? How do
I do that? What is the basic function or rule for making these type
of font changes?

Thanks.
 

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