How to format fields formatted as number the way I enter the numbe

G

Guest

Hi everyone,
I have a filed of data formatted as number, I need it as number coze it has
to add up on some other reports and forms that I have (if not formatted as
number then formulas will not work). My only question is, I need numbers
entered in this filed to be displayed the way I enter them.
i.e: if 2.5 then show 2.5 not 2
if 2.30 the show 2.30 not 2.3 nor 2
if 10 then show 10 (which is good in this case)
if 100.25 then 100.25 not 100 nor 100.2
basically, I need them to be displayed exactly the way I enter them.
I have searched and find something similar but not anything that could sort
this problem. I’ve also manipulated with decimal places etc… they failed, too.

I appreciate any help provided!
Regards, Adnan
Computer Science Student, Kosovo
How to format fields formatted as number the way I enter the number
 
S

Steve Schapel

Adnan,

I think you're out of luck here. If you want to show 2.5 as 2.5, and
show 2.3 as 2.30, then this will not be possible in a Number field. The
only way I can think of, is to use a Text data type field, and then,
when you need to use them in your totals and calculations, you will have
to use the Val() function, in your queries or else in the calculation
expressions on your forms and reports, to convert to numerical values.
 
G

Guest

Thank you Steve for your help. I’ll try this other alternative which should
suit my needs but need a little help here, too. In filed formatted as number,
how do I have the filed display default value 0.00 and be able to enter
numbers 2.20 or 10.15 or 115.45 or 2,285.35?

Again, than you for your MVP time!
Regards, Adnan
 
S

Steve Schapel

Adnan,

Set the Format property of the textbox on your form/report to Standard
and the Decimal Places property to 2.
 
J

John Vinson

Steve,
I followed ur instructions, the issue is every time I enter 10.50 it show
10.5 instead, I need 0 to be displayed, too.

Try setting the Format property to

#.00


John W. Vinson[MVP]
 
S

Steve Schapel

Adnan,

I didn't see any picture at the url you provided. I suppose it was a
screen shot of your property sheet. This is very odd. Please re-check
the properties for the textbox on the form, that the Format property is
set to:
Standard
.... and the Decimal Places property is set to:
2

For me, these settings provide the functionality you requested.
 
G

Guest

Thank you Steve, Thank you John!

Filed Size: Single
Format: #,##0.00 or #.00
Decimal Places: 2
…did the job!

Steve, URL link has changed to http://punaime.itgo.com/msaccess.html ---
thank you for your help! As you can see on the pic I’m also trying to have a
default value 0.0 on this numbered filed but I can’t seam to work this out,
this is not that much problem, a single 0 is doing the job anyway, but this
0.0 would help me one some other things.

John, I’m reading your book, it looks great so far! Appreciate your help on
this community, too.

Regards, Adnan :)
Computer Science Student, Kosovo
 
S

Steve Schapel

Adnan,

I was referring to the Format property of the textbox on the form. Set
it to Standard. I see that you have the Default Value property of the
field in table design set to "0.0". This is not correct. It is a
number, so should not be enclosed in ""s. Set it to 0. If you set the
Format to Standard, or else to #,##0.00 and the Decimal Places property
*on the form* to 2, then you will get the behaviour you requested.
 

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