Re: Reset a number back to 1 at the beginning of the year

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance



"=?Utf-8?B?Ym9iZWM=?=" <bobec@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in
news:36E4CAB1-2272-4CB7-9FED-B78BB04F9BD7@xxxxxxxxxxxxx:

> I have a project I am working on where the client requires a document
> number to increment by 1 each time and the prefix of the number is the
> year (ex. 05-00001, 05-00002, etc.) I need to program the number on
> the form to roll back to "06-00001" at the beginning of next year (And
> subsequent years).

You need two columns: YearNumber and SerialNumber. It's then a trivial
business to use a DMax() call to find the largest number allocated for the
particular year. It's even easiser to contatenate the fields on forms and
reports. Google for "Access Custom Autonumbers" for more details.


Tim F

.



Relevant Pages

  • [SOAP]Problem with namespace in Soap Header
    ... I have a .NET Web Service. ... I must write a client in PHP5. ... the ns1 prefix which appears in ... does not be inherited in UID and Site. ...
    (comp.lang.php)
  • Re: [PHP] counting with leading zeros
    ... given the prefix 'bar' i do ... /* increment, format with leading zero again if necessary, ... sort($filenames); ... I'm content to not worry about overflow in this ...
    (php.general)
  • Re: tricky jdbc issue
    ... >>> unrelated updates of salary to be occasionally lost in production. ... so only one increment has been performed. ... This is why the problem occurs - it's possible for a client to ... different in detail (obviously no need for interruptions etc) but the ...
    (comp.lang.java.programmer)
  • Re: Synchronization between 2 PHP threads?
    ... >>contains a counter field that I need to increment every time I save a ... >>Increment TableA counter ... Essentially Table A is a client table, ... Would a MySQL Write lock on Table A prevent another thread ...
    (comp.lang.php)
  • Re: [Full-Disclosure] Heads up: Possible lsass worm in the wild
    ... I have seen this one active and in use, it is connecting to ... #!tenzkor #- prefix to each client ...
    (Full-Disclosure)