How can I start Autonumber with 0001 in MS Access

  • Thread starter Thread starter Guest
  • Start date Start date
I suggest you may not want to use Autonumber for that use. Autonumbers
are designed to provide unique numbers. It in not designed to provide
numbers in order and for a number of reasons may not do so. As a result
using them in any application where the user sees the numbers is likely to
end up with confusion.

There are other ways of providing the numbers you want depending on the
particual application.
 
So what are those ways? She obviously needs the number for a particular
reason in Access, so please assist?
 
So what are those ways? She obviously needs the number for a particular
reason in Access, so please assist?

One way is to use a Number... Long Integer for this field, instead of
any type of Autonumber.

Use a Form to do ALL data entry to the table. Have a textbox bound to
this ID field, let's call it txtID, with a Format property of "0000"
to force leading zeros (the number 1 and the number 0001 *are the same
number* just displayed differently).

In the Form's BeforeInsert event put code like:

Private Sub Form_BeforeInsert(Cancel as Integer)
Me!txtID = NZ(DMax("[ID]", "[tablename]")) + 1
End Sub

John W. Vinson[MVP]
 

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

Autonumber 1
Using Autonumber 1
Autonumber Formating Errors 2
Part Autonumber 2
Link Access to Excel export back to excel 3
Format autonumber 1
Importing Excel to Access Table 2
Autonumber 7

Back
Top