Does Access have formats like Excel does?

R

Roy Ristie

Hi folks,

I need to highlight negative numbers in red on a sub-form.

Q1. is there a way to do this without writing code? I'm thinking along the
lines of excel's custom cell formattig.

Q2. if i have to write code can someone suggest how best to do it. by this i
mean, where can i hang my code on(event-wise).

mucho thanks

roy
 
D

Douglas J. Steele

Yes, Access has formats that can do this.

From the Help file:

Custom number formats can have one to four sections with semicolons (;) as
the list separator. Each section contains the format specification for a
different type of number.

Section Description
First The format for positive numbers.
Second The format for negative numbers.
Third The format for zero values.
Fourth The format for Null values.

For example, you could use the following custom Currency format:

$#,##0.00[Green];($#,##0.00)[Red];"Zero";"Null"

This number format contains four sections separated by semicolons and uses a
different format for each section.
If you use multiple sections but don't specify a format for each section,
entries for which there is no format either will display nothing or will
default to the formatting of the first section.
 
Top