Creating a unique number

D

dympna.kearney

Hi I am trying to create a unique number field, starting at a specific
number and incrementing by 1 each time a new record is added to the
database via a form (user friendly).
I have tried to do the "change the starting value of an auto number
field MDB" but this from what I read is not correct in that the
numbers are unique but not necessarily in increments of 1. which is
what i found when i tried to enter dummy data.

Can you advise what I should use, I have read that before update in
the form could be used...
But I am a total novice at this, so I need dummies guide to doing
this...


thanks in advance
 
G

Guest

You're going to have to create a number field and then using code determine
the next available number to populate new records with.

Using the Dmax() function you should be able to determine the greatest entry
number and then you simply add 1 to it to get the next available number

Hope this helps,

Daniel
 
B

Bruno Campanini

Hi I am trying to create a unique number field, starting at a specific
number and incrementing by 1 each time a new record is added to the
database via a form (user friendly).

CurrentDB.Execute "ALTER TABLE YourTableName _
ALTER COLUMN YourFieldName _
COUNTER(InitialValue, Step);"

Bruno
 

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

Similar Threads

unique invoice number 17
How do I set up a unique number? 1
Update unique number 8
Automatic unique number 2
Unique number 1
Auto Number 3
Unique number 8
Counting unique records 9

Top