Numerical Formatting in a Report

  • Thread starter bridgfod via AccessMonster.com
  • Start date
B

bridgfod via AccessMonster.com

Hello,

I am trying to whittle down some duplicate files on our server. One of the
lines in the report provides a summary of a particular duplicated file. In
the text box control, I have the following:

="There are " & [subCounter] & " additional copies of '" & [File_Name] & "'
potentially using up to " & [footsum] & " MB of space."

which works, but is ugly. The [footsum] entity is calculated by dividing the
file size in bytes by 1024 and again by 1024 to yield MB. Is there a way to
round the [footsum] calculation to 3 digits after the decimal, instead of the
14 or so that it wants to put there?

I did set the properties to "Fixed" and 3 decimals, and that worked when the
only thing that the textbox was putting out was the contents of [footsum].

Are there any switches that can be incorporated into the "& [footsum] &"
portion of the statement to control the formatting of this value?

Thanks,

Dale
 
A

Al Campagna

bridgfod,
Try inserting this into the concatenation...
.... & Format([FootSum],"#.000") & ...
--
hth
Al Campagna . Candia Computer Consulting . Candia, NH USA
Microsoft Access MVP
http://home.comcast.net/~cccsolutions

"Find a job that you love, and you'll never work a day in your life."
 
B

Bob Barnes

Similar question...no answer to yours.

I have...
=(Round([Text148]/([Text147]/60),2))

And set the Report Field to Fixed, 2 decimal places...but....
42.00 displays as 42
53.60 displays as 53.6.

Thoughts?

TIA - Bob
 
M

Marshall Barton

Bob said:
Similar question...no answer to yours.

I have...
=(Round([Text148]/([Text147]/60),2))

And set the Report Field to Fixed, 2 decimal places...but....
42.00 displays as 42
53.60 displays as 53.6.


Try setting the text box's Format property to:

0.00
 
B

Bob Barnes

Marsh,

Entering 0.00 converts by access to Fixed...didn't work.
Tried the "#.000" below and it didn't work either.

Thank you - Bob

Marshall Barton said:
Bob said:
Similar question...no answer to yours.

I have...
=(Round([Text148]/([Text147]/60),2))

And set the Report Field to Fixed, 2 decimal places...but....
42.00 displays as 42
53.60 displays as 53.6.


Try setting the text box's Format property to:

0.00
 
B

Bob Barnes

Al,

Entering 0.00 converts by access to Fixed (from Marsh)...didn't work.
Tried the "#.000" below and it didn't work either.

Thank you - Bob


Al Campagna said:
bridgfod,
Try inserting this into the concatenation...
.... & Format([FootSum],"#.000") & ...
--
hth
Al Campagna . Candia Computer Consulting . Candia, NH USA
Microsoft Access MVP
http://home.comcast.net/~cccsolutions

"Find a job that you love, and you'll never work a day in your life."

bridgfod via AccessMonster.com said:
Hello,

I am trying to whittle down some duplicate files on our server. One of the
lines in the report provides a summary of a particular duplicated file. In
the text box control, I have the following:

="There are " & [subCounter] & " additional copies of '" & [File_Name] & "'
potentially using up to " & [footsum] & " MB of space."

which works, but is ugly. The [footsum] entity is calculated by dividing the
file size in bytes by 1024 and again by 1024 to yield MB. Is there a way to
round the [footsum] calculation to 3 digits after the decimal, instead of the
14 or so that it wants to put there?

I did set the properties to "Fixed" and 3 decimals, and that worked when the
only thing that the textbox was putting out was the contents of [footsum].

Are there any switches that can be incorporated into the "& [footsum] &"
portion of the statement to control the formatting of this value?

Thanks,

Dale
 
M

Marshall Barton

Fixed should also work in this case.

I can't explain why, but what you're describing is the
effect of using format General Number. The only way I can
think of that happening is if your control source expression
is somehow being treated as a text value.
--
Marsh
MVP [MS Access]


Bob said:
Entering 0.00 converts by access to Fixed...didn't work.
Tried the "#.000" below and it didn't work either.
Bob said:
Similar question...no answer to yours.

I have...
=(Round([Text148]/([Text147]/60),2))

And set the Report Field to Fixed, 2 decimal places...but....
42.00 displays as 42
53.60 displays as 53.6.

Marshall Barton said:
Try setting the text box's Format property to:

0.00
 
B

Bob Barnes

Marsh,

The Field on the Access Report is..
=Format((Round([Text148]/([Text147]/60),2)),"Fixed")

I've tried all kinds of "Format"....something like 62.00
displays as 62, and 34.50 displays as 34.5.

IF we could only get the "Format - Cells - Number - 2
Decimal Places" like in Excel...

Could this be a "No Go"?? The Post before mine...tried
the same thing w/ 3 decimal places.

Thank you - Bob

Marshall Barton said:
Fixed should also work in this case.

I can't explain why, but what you're describing is the
effect of using format General Number. The only way I can
think of that happening is if your control source expression
is somehow being treated as a text value.
--
Marsh
MVP [MS Access]


Bob said:
Entering 0.00 converts by access to Fixed...didn't work.
Tried the "#.000" below and it didn't work either.
Bob Barnes wrote:
Similar question...no answer to yours.

I have...
=(Round([Text148]/([Text147]/60),2))

And set the Report Field to Fixed, 2 decimal places...but....
42.00 displays as 42
53.60 displays as 53.6.

Marshall Barton said:
Try setting the text box's Format property to:

0.00
 
M

Marshall Barton

Bob said:
The Field on the Access Report is..
=Format((Round([Text148]/([Text147]/60),2)),"Fixed")

I've tried all kinds of "Format"....something like 62.00
displays as 62, and 34.50 displays as 34.5.

IF we could only get the "Format - Cells - Number - 2
Decimal Places" like in Excel...

Could this be a "No Go"?? The Post before mine...tried
the same thing w/ 3 decimal places.


Well, that's not what I was suggesting, but it should have
worked.

What I was suggesting was to leave the control source
expression as: =Round([Text148]/([Text147]/60),2)
and set the Format **property** to 0.00 or Fixed.

But, either approach should produce the same result, which
they did in my tests.

Maybe someone else has an idea, but I can't explain whatever
is causing your problem.
 
B

Bob Barnes

From Marsh...
What I was suggesting was to leave the control source
expression as: =Round([Text148]/([Text147]/60),2)
and set the Format **property** to 0.00 or Fixed.

Marsh - That's what I tried...It's Access 2003 under Windows 2000.
I wonder if there's "any chance" the most recent Security Updates
(about 2 weeks ago) has affected this??? A fellow worker has said
his PC Apps have been adversly affected since the Windows 2000
Security Update 2 weeks ago.

We're willing to settle for this...what's our alternative??

Thank you..Bob

Marshall Barton said:
Bob said:
The Field on the Access Report is..
=Format((Round([Text148]/([Text147]/60),2)),"Fixed")

I've tried all kinds of "Format"....something like 62.00
displays as 62, and 34.50 displays as 34.5.

IF we could only get the "Format - Cells - Number - 2
Decimal Places" like in Excel...

Could this be a "No Go"?? The Post before mine...tried
the same thing w/ 3 decimal places.


Well, that's not what I was suggesting, but it should have
worked.

What I was suggesting was to leave the control source
expression as: =Round([Text148]/([Text147]/60),2)
and set the Format **property** to 0.00 or Fixed.

But, either approach should produce the same result, which
they did in my tests.

Maybe someone else has an idea, but I can't explain whatever
is causing your problem.
 
M

Marshall Barton

Bob said:
From Marsh...
What I was suggesting was to leave the control source
expression as: =Round([Text148]/([Text147]/60),2)
and set the Format **property** to 0.00 or Fixed.

Marsh - That's what I tried...It's Access 2003 under Windows 2000.
I wonder if there's "any chance" the most recent Security Updates
(about 2 weeks ago) has affected this??? A fellow worker has said
his PC Apps have been adversly affected since the Windows 2000
Security Update 2 weeks ago.

We're willing to settle for this...what's our alternative??


Since I have never used Win2000, I can not comment
intelligently on what, if any, problems exist in your
configuration.

Before going off on that kind of tangent, I would try
creating a new database with a simple form that tried to
reproduce the problem in the simplest situation you can
create. If that works, then start adding in a few parts of
your problem db until the problem reappears and you can
isolate the part that's causing trouble. If you can add
everything without getting the problem, then I guess you can
chalk it up to some kind of corruption.
 
B

Bob Barnes

Me - not so smart...I hadn't set the Fixed 2 in the Detail Textbox...In
Design View,
I had Fixed 2 ONLY on the Group Footer.

Thank all of you (in "General Questions" also)..

Bob


Marshall Barton said:
Bob said:
From Marsh...
What I was suggesting was to leave the control source
expression as: =Round([Text148]/([Text147]/60),2)
and set the Format **property** to 0.00 or Fixed.

Marsh - That's what I tried...It's Access 2003 under Windows 2000.
I wonder if there's "any chance" the most recent Security Updates
(about 2 weeks ago) has affected this??? A fellow worker has said
his PC Apps have been adversly affected since the Windows 2000
Security Update 2 weeks ago.

We're willing to settle for this...what's our alternative??


Since I have never used Win2000, I can not comment
intelligently on what, if any, problems exist in your
configuration.

Before going off on that kind of tangent, I would try
creating a new database with a simple form that tried to
reproduce the problem in the simplest situation you can
create. If that works, then start adding in a few parts of
your problem db until the problem reappears and you can
isolate the part that's causing trouble. If you can add
everything without getting the problem, then I guess you can
chalk it up to some kind of corruption.
 
B

Bob Barnes

Me - not so smart...I hadn't set the Fixed 2 in the Detail Textbox...In
Design View,
I had Fixed 2 ONLY on the Group Footer.

Thank all of you (in "General Questions" also)..

Bob


Al Campagna said:
bridgfod,
Try inserting this into the concatenation...
.... & Format([FootSum],"#.000") & ...
--
hth
Al Campagna . Candia Computer Consulting . Candia, NH USA
Microsoft Access MVP
http://home.comcast.net/~cccsolutions

"Find a job that you love, and you'll never work a day in your life."

bridgfod via AccessMonster.com said:
Hello,

I am trying to whittle down some duplicate files on our server. One of the
lines in the report provides a summary of a particular duplicated file. In
the text box control, I have the following:

="There are " & [subCounter] & " additional copies of '" & [File_Name] & "'
potentially using up to " & [footsum] & " MB of space."

which works, but is ugly. The [footsum] entity is calculated by dividing the
file size in bytes by 1024 and again by 1024 to yield MB. Is there a way to
round the [footsum] calculation to 3 digits after the decimal, instead of the
14 or so that it wants to put there?

I did set the properties to "Fixed" and 3 decimals, and that worked when the
only thing that the textbox was putting out was the contents of [footsum].

Are there any switches that can be incorporated into the "& [footsum] &"
portion of the statement to control the formatting of this value?

Thanks,

Dale
 

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