Small textbox width forces rounding.

G

Guest

I have a textbox with a small width that fits only two digits. When I try to
enter 10.5 in the textbox, Access rounds it to 11. Is there a way to prevent
it from rounding automatically, I don't mind that 10.5 be clipped.
 
A

Al Campagna

Ray,
It's not the width of the text control that's forcing 10.5 to 11, it's the field
definition in your table. You probably have it set to to Byte or Integer, which means
there can be no decimal places.
Try defining that field as Single. Also, format the form field for as many decimal
places as you want to display.
 
G

Guest

I actually have it defined as Double at the table level where the Decimal
property is set to Auto. What's weird is that I see 11 in the textbox but the
moment I put the cursor in the textbox the value changes to 10.5. The value
that's being stored in the table is 10.5 which is what I want. But the moment
the cursor leaves the textbox, it goes back to 11.
 
J

J. Goddard

Hi -

Sounds as if the format property for the textbox may be incorrect. Try
setting the format to Fixed, and the decimal places to 1 (or whatever
you require)

P.S. If you widen the textbox, do you see 10.5 or 11?


John
 
J

J. Goddard

Hi -

I just tried this myself. the "11" is due to the text box not being
wide enough. If you set the format to Fixed and the decimal places to
1, (or whatever), you will get all the decimal places, but the text will
wrap in the box.

John
 

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