generate auto numbers

S

SaGe

I am trying to generate a number that increments by one automatically in a
form. I then need to reset this field so it starts at zero at the beginning
of every year. Please help!!
 
M

Mike Painter

SaGe said:
I am trying to generate a number that increments by one automatically
in a form. I then need to reset this field so it starts at zero at
the beginning of every year. Please help!!
You will have to have a table that maintains the number and call it in code
with dLookup, then increment it by one and update the table INSERT INTO is
one way to do it.

If this is a single user situation then that and code to determine when to
reset the value is all you will need.
If multi-user then the Access Developers handbook has code that will be
fairly bullet proof. It's worth buying just for that alone.

Restarting at zero and other such schemes are rarely needed in a database
situation since queries can give you the order and count without the problem
of finding out if this was number 9 from this year or three years ago..
 
Top