Can Leading Zero Be Hidden?

C

croy

I have a number field (double) where it would be nice if
Access didn't show a leading zero. Decimal Places is set to
"Auto", and that is good, except for the leading zero.
Format is currently blank. Access 2002.

Thanks,
croy
 
J

John W. Vinson

I have a number field (double) where it would be nice if
Access didn't show a leading zero. Decimal Places is set to
"Auto", and that is good, except for the leading zero.
Format is currently blank. Access 2002.

Thanks,
croy

Ummm....

It doesn't, on my computer. A Double containing 3123.1581231 displays just in
that way, not as 03123.

Where did you add it? In a table, a form, a report, a query? Could you post an
example of what you're seeing?
 
C

croy

Ummm....

It doesn't, on my computer. A Double containing 3123.1581231 displays just in
that way, not as 03123.

Where did you add it? In a table, a form, a report, a query? Could you post an
example of what you're seeing?

So, mind-reading is not your strong suit, eh? ;-)

When the value is less than one, and more than zero, Access
displays "0.25", for example (I know this is the way any
normal user would prefer, but....). For this particular
field, I would rather see ".25".

Thanks for your reply.
 
D

Dirk Goldgar

croy said:
I have a number field (double) where it would be nice if
Access didn't show a leading zero. Decimal Places is set to
"Auto", and that is good, except for the leading zero.
Format is currently blank. Access 2002.


Do you mean that, for numbers less than 1, you want the displayed value to
start with the decimal point (e.g., ".123") instead of with the zero digit
(e.g., "0.123")? If so, why? It's easy to overlook the decimal place when
it isn't preceded by 0.

If this *is* what you want to do, you can easily set up a calculated control
that uses a combination of VBA functions to format the numeric value and
strip off the leading 0. But such a calculated control would not be
editable, so if you also need the user to be able to update the value, you'd
need a second text box to display the raw value, and some method to switch
between the two text boxes. Very doable, but a lot of trouble to go to if
it isn't really necessary.
 
C

croy

Do you mean that, for numbers less than 1, you want the displayed value to
start with the decimal point (e.g., ".123") instead of with the zero digit
(e.g., "0.123")? If so, why?

It's for visually cross-checking between handwritten data on
paper forms and the check report that was printed after the
data was entered into an Access db. The more the "format"
of the Access report looks like what folks normally print on
paper, the quicker it is for mind and eyeballs to match the
two.
It's easy to overlook the decimal place when it isn't preceded by 0.

If this *is* what you want to do, you can easily set up a calculated control
that uses a combination of VBA functions to format the numeric value and
strip off the leading 0. But such a calculated control would not be
editable, so if you also need the user to be able to update the value, you'd
need a second text box to display the raw value, and some method to switch
between the two text boxes. Very doable, but a lot of trouble to go to if
it isn't really necessary.

Thanks.
croy
 

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