Formatting Decimal Places

P

Paul Hammond

On my report I have two columns that I want formatted Standard, 2 decimal
places.
This works everywhere except on the Detail section where it shows as many
decimal places as space allows.

How come?

TIA
Paul Hammond
 
D

Duane Hookom

Set these properties of the text box:
Format: Standard
Decimals: 2

If that doesn't work then you haven't provided us with significant
information about your "two columns".
 
P

Paul Hammond

Those are the settings I was using. The two "columns" are actually a series
of text boxes in the group footer sections and the detail section. There is
a difference I discovered.

To avoid a divided by zero error I put an Iif statment in the query which
returns an "n/a" if the denominator is a zero. This is the value in the
detail section, which does not format correctly.

I resolved this by using Iif([MyField]=0,0,[ThisField]/[MyField])

Now I get a zero instead of an "n/a", which for my purposes here will work,
but I'd entertain other solutions.

Paul+
 
D

Duane Hookom

You could also try
=Iif([MyField]=0,Null,[ThisField]/[MyField])
Then you can set the format property to display "n/a" in place of a Null
value. The "Format property for Numeric Values" is explained in Help.

--
Duane Hookom
MS Access MVP
--

Paul Hammond said:
Those are the settings I was using. The two "columns" are actually a
series
of text boxes in the group footer sections and the detail section. There
is
a difference I discovered.

To avoid a divided by zero error I put an Iif statment in the query which
returns an "n/a" if the denominator is a zero. This is the value in the
detail section, which does not format correctly.

I resolved this by using Iif([MyField]=0,0,[ThisField]/[MyField])

Now I get a zero instead of an "n/a", which for my purposes here will
work,
but I'd entertain other solutions.

Paul+

--
Can't we all just get along?


Duane Hookom said:
Set these properties of the text box:
Format: Standard
Decimals: 2

If that doesn't work then you haven't provided us with significant
information about your "two columns".
 
P

Paul Hammond

All is well.

Thanks for the tip.
--
Can't we all just get along?


Duane Hookom said:
You could also try
=Iif([MyField]=0,Null,[ThisField]/[MyField])
Then you can set the format property to display "n/a" in place of a Null
value. The "Format property for Numeric Values" is explained in Help.

--
Duane Hookom
MS Access MVP
--

Paul Hammond said:
Those are the settings I was using. The two "columns" are actually a
series
of text boxes in the group footer sections and the detail section. There
is
a difference I discovered.

To avoid a divided by zero error I put an Iif statment in the query which
returns an "n/a" if the denominator is a zero. This is the value in the
detail section, which does not format correctly.

I resolved this by using Iif([MyField]=0,0,[ThisField]/[MyField])

Now I get a zero instead of an "n/a", which for my purposes here will
work,
but I'd entertain other solutions.

Paul+

--
Can't we all just get along?


Duane Hookom said:
Set these properties of the text box:
Format: Standard
Decimals: 2

If that doesn't work then you haven't provided us with significant
information about your "two columns".
--
Duane Hookom
MS Access MVP
--

On my report I have two columns that I want formatted Standard, 2
decimal
places.
This works everywhere except on the Detail section where it shows as
many
decimal places as space allows.

How come?

TIA
Paul Hammond
 

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