Creating a unique number

  • Thread starter Thread starter dympna.kearney
  • Start date Start date
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
 
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
 
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
 
Back
Top