Re: Leading zero for Default Number



On Tue, 24 Jul 2007 10:32:10 -0700, Lambi000
<Lambi000@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote:

My users all want their auto-numbers to start with the year....07...and
that's going to last for the next two years.

Then you cannot use Autonumbers. You can't control an autonumber's value, and
it will not start over on January 1, and cannot be made to do so.

I have a text field that I am
trying to make default to 07 for this year and then another field with an
auto number to increment it.

Why can't I make the default in the text field "07" without it reverting
back to 7. I've tried making up my own mask, but I can't figure out where
I'm supposed to place the zero and the 7.

A Number IS A NUMBER. It's not stored with leading zeros; it's actually stored
as a binary string of bits. The numbers 7 and 07 and James Bond's 007 are *all
the exact same number* - stored as 00000000000000000000000000000111 to be
exact.

You'll need to use a Text field, not a number, and write VBA code to insert a
text string (such as Format(Date(), "yy") ) and an incrementing number. I'd
really recommend against having such a field, with two separate pieces of
information in it - a field should be atomic.

If you need a format like 07-00000 through 07-99999, starting over in the new
year, it can be done with some VBA code - but it gets complicated when you
have multiple users. Do a search for "Custom Counter" for examples.

John W. Vinson [MVP]
.



Relevant Pages

  • Re: On writing negative zero - with or without sign
    ... exact zero, contrary to your claim that there is no such thing. ... And I noted that there is a subset of continuous reals that can be ... representation to account for "actual zero"). ...
    (comp.lang.fortran)
  • Re: On writing negative zero - with or without sign
    ... I responded to the issue of an "exact" zero. ... that doesn't mean I believe the thermometer example represents a ... Propagate the quantization error of 0.1 degrees. ...
    (comp.lang.fortran)
  • Re: On writing negative zero - with or without sign
    ... exact zero, contrary to your claim that there is no such thing. ... that using float for something *other* than simulating continuous reals ... "exactitude" in general, but rather a very specific issue, namely ...
    (comp.lang.fortran)
  • Re: On writing negative zero - with or without sign
    ... of representing an "exact" zero... ... My definition of an "exact" zero is whatever internal representation ... *only* value associated with that approximation. ... A subset of floating point numbers can have an exact representation. ...
    (comp.lang.fortran)
  • Re: On writing negative zero - with or without sign
    ... I sure hope that a program can represent an exact zero. ... programs represent, manipulate, and produce approximations. ... (which is not what floating point does) ...
    (comp.lang.fortran)