1. Registered User
Join Date
Sep 2003
Posts
8

I have a text box in the footer of a subform. This textbox performs a calculation. It sums all the data, then divides the sum by 40, then divides that number by 4.33. I copied this text box onto my main form.

I cannot figure out how to get the resulting number to have just one digit to the right of the decimal point. I have tried changing the decimal properties from auto to 1, but nothing happens.

Thanks.

2. Registered User
Join Date
Feb 2003
Location
Auckland, NZ
Posts
150

i.e.

the textbox source will look something like this

This will round the value to 1 decimal point

3. Registered User
Join Date
Sep 2003
Posts
8
What exactly is my syntax? I am not real familiar with the code.

My formula is =Sum([Hours]/40/4.33)

What brackets do I use around my entire calculation? How exactly should it look?

i.e.

the textbox source will look something like this

This will round the value to 1 decimal point

4. Registered User
Join Date
Feb 2003
Location
Auckland, NZ
Posts
150
It should look something like this

=Round(Sum([Hours]/40/4.33), 1)

5. Registered User
Join Date
Sep 2003
Posts
8
That did not work. Also, in your posting, the [/SIZE][/QUOTE] does not show up, but I see it now when I am trying to reply???

I tried that too, and it still doesn't work. I get an error message #Name?

Who would have thought something so simple could be so difficult. Thanks for any additional input you can provide.

It should look something like this

=Round(Sum([Hours]/40/4.33), 1)

6. Registered User
Join Date
Feb 2003
Location
Auckland, NZ
Posts
150
The #Name error refers to [Hours] in the formula. Make sure that the Field [Hours] exist in the Recordsource of this form.

Also Make sure that the equals sign is before the formula.

7. Registered User
Join Date
Aug 2003
Location
SW Ohio
Posts
198
Try =Format(Sum([Hours]/40/4.33),"0.00")

And rename the textbox in the footer as somehting like Sum_Hours

The [/SIZE][/QUOTE] is part of the vb code and is explained here http://www.dbforums.com/misc.php?action=bbcode

8. Registered User
Join Date
Sep 2003
Posts
8
THAT WORKED!! But it generated another issue. Now the result is left aligned instead of right aligned as it was when it had 5 numbers after the decimal. Any suggestions?

Thanks so much for your time. This is the last little thing I need to have one great looking form!

Originally posted by jimpen
Try =Format(Sum([Hours]/40/4.33),"0.00")

And rename the textbox in the footer as somehting like Sum_Hours

The
is part of the vb code and is explained here http://www.dbforums.com/misc.php?action=bbcode [/SIZE][/QUOTE]

9. Registered User
Join Date
Aug 2003
Location
SW Ohio
Posts
198
Just select the text box in form design and hit the Align Right button on the toolbar.

10. Registered User
Join Date
Sep 2003
Posts
8
Thanks. I have spent so much time on this one issue, I missed the obvious at the end. Everything works great now.

Originally posted by jimpen
Just select the text box in form design and hit the Align Right button on the toolbar.

#### Posting Permissions

• You may not post new threads
• You may not post replies
• You may not post attachments
• You may not edit your posts
•