Automatic Serial Number

goju

Registered User.
Local time
Today, 23:02
Joined
Apr 7, 2005
Messages
77
would like an automatic serial number when i create a new record.(i.e.159352)

This number needs to be updated annualy to a new number.

how do i go about getting 159352 in record 1 and then to update to 159353 on the next record.

very new to access sorry

is just creating a table ith all the serial numbers in and then (some how) getting it to update.

Any help appricated
 
Is this another thread on the exact same subject? :mad:
 
You have to seed the first record with your starting value. In the form where you add new records, use DMax() to find the largest existing number and add 1 to it.
 
right i used the following
=Nz(DMax("[EKGB Number]","[qryForForm]"),0)+1

this seem to wok fine until i went back changed a record, and reopened it

tried a to start a new record and instead of increasing the number by 1 it returned a 0 tried another new record this returned error.

any ideas
 
Please search this forum for the topic "autonumber" and then look at the entries discussing how to reset an autonumber.

I'm not saying you will use an autonumber. Some of the threads on the topic include discussions on what to use / how to use it when a straight autonumber is inappropriate or incorrect.

In your case, I'm going to guess that a true autonumber isn't going to work. But there are other ways.

By the way, if editing a record changed your number, you have something wrong on the form used to make the change. If editing from a datasheet view (table OR query) did this, you have a default-value defined incorrectly.
 
If you are assigning the number in a form as you add the record, you can't use the same form to edit the record. Set up one form for record creation and set the form Properties to Data Entry. Create another form for editing existing records without the code for allocating the number.
 

Users who are viewing this thread

Back
Top Bottom