From: Donna on
we use a sequential number system that begins new each month but we need it
to hold 4 places 0001, 0002. etc. I would like to know if Access will do
this.
From: Dirk Goldgar on
"Donna" <Donna(a)discussions.microsoft.com> wrote in message
news:484176CC-EFDE-48BB-BF18-C5BEFD695710(a)microsoft.com...
> we use a sequential number system that begins new each month but we need
> it
> to hold 4 places 0001, 0002. etc. I would like to know if Access will do
> this.


Yes, but ...

You can't use the built-in autonumber field to do what you want. Therefore
you'll need some VBA code, or maybe a macro, to generate each new number.
Assuming what you mean is that you need the numbers for each month to begin
at 0001 and go on sequentially up to a maximum of 9999, that means the
process of generating a new number will have to first lookup the highest
number already assigned for this month, then add 1 to it -- and raise some
sort of error if the the new number exceeds 9999. If there is no existing
number assigned to this month, it should generate the number 0001. This is
quite straightforward, when sufficient details are known about the tables
and fields involved.

It isn't clear to me whether or not you really need to store these numbers
as a string, in which case you need to convert between a true number (that
you can add 1 to) and a formatted string composed of four numeric digits.
However, that is easily handled by the Format() function.

--
Dirk Goldgar, MS Access MVP
Access tips: www.datagnostics.com/tips.html

(please reply to the newsgroup)

From: Risse on

"Donna" <Donna(a)discussions.microsoft.com> kirjoitti
viestiss�:484176CC-EFDE-48BB-BF18-C5BEFD695710(a)microsoft.com...
> we use a sequential number system that begins new each month but we need
> it
> to hold 4 places 0001, 0002. etc. I would like to know if Access will do
> this.