AutoNumber Customizable?

J

Jorlypong

I use job #'s for my company that begin with the year and then go up
numerically with each job. Ex.
08-001
08-002
08-003
Is there a way to have these numbers go up automatically when I enter a new
record (job) without having to type them in. I thought there would be a way
with autonumber but I then I am in trouble when the next year rolls around. Ex
08-658
08-659
09-001
09-002
09-003
Any ideas?
 
M

MGFoster

Jorlypong said:
I use job #'s for my company that begin with the year and then go up
numerically with each job. Ex.
08-001
08-002
08-003
Is there a way to have these numbers go up automatically when I enter a new
record (job) without having to type them in. I thought there would be a way
with autonumber but I then I am in trouble when the next year rolls around. Ex
08-658
08-659
09-001
09-002
09-003
Any ideas?

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Have a table that holds the job numbers and just get the DMax(), or a
Max() query, each time you need a new number:

Query: SELECT MAX(job_nbr) FROM Jobs

VBA: lngMaxJobNbr = DMax("job_nbr", "Jobs")

You can run this in the form's BeforeUpdate event to assign it to the
job number.

The problem w/ this solution is in a multi-user application someone may
select a number, crash out and the number will be lost (probably very
rare). Also, the user will not see the number until the record is
saved. You can set it up to get the next job number when the record is
started, like an AutoNumber, but the same problem with AutoNumber exists
- the user may cancel the job and the new number is lost.

--
MGFoster:::mgf00 <at> earthlink <decimal-point> net
Oakland, CA (USA)
** Respond only to this newsgroup. I DO NOT respond to emails **

-----BEGIN PGP SIGNATURE-----
Version: PGP for Personal Privacy 5.0
Charset: noconv

iQA/AwUBSX+lOoechKqOuFEgEQLJngCfUx2EkOjsayIC3A1pkazr8+MlPzAAoKlk
cEVee9zfGJx+6o+cM6f1yYmd
=ogAi
-----END PGP SIGNATURE-----
 

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