Change value to an integer on a form

C

crazyj0202

I have a form that has detailed human resource info. I have a field that is
in increments of .25. The sum can be x.00, x.25, x.50,and x.75. (x bring
any number) Unless the increments =1 I do not want it to sum on a particular
field on a report.

All I want is to always change the number to an integer (round down). I.e,
if the sum on the report is 4.25, 4.50 or 4.75 I want another field to take
that number and round down to 4. I hope this can be done.

I still want the 4.25 to show on the report, but just another box that was
created just for the purpose of putting that number or whatever number
rounded down to the whole number.

(FYI the source of the textbox is =sum[sumofsar], I thought that if I put dim
text86 as integer on form open and then I copied the same =sum[sumofsar],
into the source that it would work but it did not)

Thanks
 
A

Allen Browne

Try a text box bound to:
=Sum(Int([Field1]))

Substitute your field name for Field1.
 
J

John Spencer

Or perhaps reversing the functions. Since, I interpreted the posting as
saying the user wanted to round down the sum versus sum the rounded down
values.

Int(Sum([Field1]))

--
John Spencer
Access MVP 2002-2005, 2007
Center for Health Program Development and Management
University of Maryland Baltimore County
..

Allen Browne said:
Try a text box bound to:
=Sum(Int([Field1]))

Substitute your field name for Field1.

--
Allen Browne - Microsoft MVP. Perth, Western Australia

Reply to group, rather than allenbrowne at mvps dot org.

crazyj0202 said:
I have a form that has detailed human resource info. I have a field that
is
in increments of .25. The sum can be x.00, x.25, x.50,and x.75. (x
bring
any number) Unless the increments =1 I do not want it to sum on a
particular
field on a report.

All I want is to always change the number to an integer (round down).
I.e,
if the sum on the report is 4.25, 4.50 or 4.75 I want another field to
take
that number and round down to 4. I hope this can be done.

I still want the 4.25 to show on the report, but just another box that
was
created just for the purpose of putting that number or whatever number
rounded down to the whole number.

(FYI the source of the textbox is =sum[sumofsar], I thought that if I put
dim
text86 as integer on form open and then I copied the same =sum[sumofsar],
into the source that it would work but it did not)

Thanks
 
A

Allen Browne

Thank you, John.

That's not how I originally read the question, but on a re-read, you could
be right, and the distinction is important.

--
Allen Browne - Microsoft MVP. Perth, Western Australia

Reply to group, rather than allenbrowne at mvps dot org.

John Spencer said:
Or perhaps reversing the functions. Since, I interpreted the posting as
saying the user wanted to round down the sum versus sum the rounded down
values.

Int(Sum([Field1]))

--
John Spencer
Access MVP 2002-2005, 2007
Center for Health Program Development and Management
University of Maryland Baltimore County
.

Allen Browne said:
Try a text box bound to:
=Sum(Int([Field1]))

Substitute your field name for Field1.

crazyj0202 said:
I have a form that has detailed human resource info. I have a field that
is
in increments of .25. The sum can be x.00, x.25, x.50,and x.75. (x
bring
any number) Unless the increments =1 I do not want it to sum on a
particular
field on a report.

All I want is to always change the number to an integer (round down).
I.e,
if the sum on the report is 4.25, 4.50 or 4.75 I want another field to
take
that number and round down to 4. I hope this can be done.

I still want the 4.25 to show on the report, but just another box that
was
created just for the purpose of putting that number or whatever number
rounded down to the whole number.

(FYI the source of the textbox is =sum[sumofsar], I thought that if I
put dim
text86 as integer on form open and then I copied the same
=sum[sumofsar],
into the source that it would work but it did not)
 
J

John Spencer

Well, the poster now has a solution for either problem.

--
John Spencer
Access MVP 2002-2005, 2007
Center for Health Program Development and Management
University of Maryland Baltimore County
..

Allen Browne said:
Thank you, John.

That's not how I originally read the question, but on a re-read, you could
be right, and the distinction is important.

--
Allen Browne - Microsoft MVP. Perth, Western Australia

Reply to group, rather than allenbrowne at mvps dot org.

John Spencer said:
Or perhaps reversing the functions. Since, I interpreted the posting as
saying the user wanted to round down the sum versus sum the rounded down
values.

Int(Sum([Field1]))

--
John Spencer
Access MVP 2002-2005, 2007
Center for Health Program Development and Management
University of Maryland Baltimore County
.

Allen Browne said:
Try a text box bound to:
=Sum(Int([Field1]))

Substitute your field name for Field1.

I have a form that has detailed human resource info. I have a field
that is
in increments of .25. The sum can be x.00, x.25, x.50,and x.75. (x
bring
any number) Unless the increments =1 I do not want it to sum on a
particular
field on a report.

All I want is to always change the number to an integer (round down).
I.e,
if the sum on the report is 4.25, 4.50 or 4.75 I want another field to
take
that number and round down to 4. I hope this can be done.

I still want the 4.25 to show on the report, but just another box that
was
created just for the purpose of putting that number or whatever number
rounded down to the whole number.

(FYI the source of the textbox is =sum[sumofsar], I thought that if I
put dim
text86 as integer on form open and then I copied the same
=sum[sumofsar],
into the source that it would work but it did not)
 

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