Results 1 to 6 of 6
  1. #1
    b.saimsc is offline Novice
    Windows 7 32bit Access 2010 32bit
    Join Date
    Sep 2012
    Posts
    24

    Thumbs up autonumber in access not starting at 1


    I have Created a form and 1st field SL_NO given as Autonumber it's works fine but everyday i have delete old records and enter new records in that form...my problem is it's always starts with after old record number.

    Ex : yesterday i had enter 50 records and today i have deleted those 50 records and started my work but it's continuing with 51 only....Please help me......

  2. #2
    Bob Fitz's Avatar
    Bob Fitz is offline Access Developer
    Windows XP Access 2003
    Join Date
    May 2011
    Location
    Essex UK
    Posts
    3,610
    I believe this is normal behaviour and should not be a problem if you are using the Auto-Number feature correctly. It is not meant to represent any meaningful data. It is just a unique identifier for each record. It is not necessarily sequential and can even produce negative numbers. In A2003, doing a Compact and Repair 'resets' the Auto-Number.
    If this helped, please click the star at the bottom left of this posting and add to my reputation . Many thanks.
    Bob Fitzpatrick

  3. #3
    b.saimsc is offline Novice
    Windows 7 32bit Access 2010 32bit
    Join Date
    Sep 2012
    Posts
    24
    How to reset AutoNumber? I need sequential please help me..............

  4. #4
    Bob Fitz's Avatar
    Bob Fitz is offline Access Developer
    Windows XP Access 2003
    Join Date
    May 2011
    Location
    Essex UK
    Posts
    3,610
    As I said in my last post Auto-Number is not necessarily sequential. To create your own sequential number see: http://www.599cd.com/tips/access/inc...r-own-counter/
    If this helped, please click the star at the bottom left of this posting and add to my reputation . Many thanks.
    Bob Fitzpatrick

  5. #5
    b.saimsc is offline Novice
    Windows 7 32bit Access 2010 32bit
    Join Date
    Sep 2012
    Posts
    24
    Hi Bob
    Thank you for your earliest response i really appreciate your comments.....As your suggestion i have gone through your link and i have followed but i am getting different result i.e All records represents same number means 1 only....here the formula please help me....
    formula:
    Private Sub Form_BeforeInsert(Cancel As Integer)
    SL_NO = Nz(DMax("SL_NO", "Nasco Production")) + 1
    End Sub

    Thank you...........

  6. #6
    Bob Fitz's Avatar
    Bob Fitz is offline Access Developer
    Windows XP Access 2003
    Join Date
    May 2011
    Location
    Essex UK
    Posts
    3,610
    I can't see anything wrong with the code you have.
    Can you try the code below and tell us the values shown in the message boxes.
    Code:
    Private Sub Form_BeforeInsert(Cancel As Integer)
      Msgbox Nz(DMax("SL_NO", "Nasco Production")) 
      Msgbox Nz(DMax("SL_NO", "Nasco Production"))  + 1
      SL_NO = Nz(DMax("SL_NO", "Nasco Production")) + 1
    End Sub
    If this helped, please click the star at the bottom left of this posting and add to my reputation . Many thanks.
    Bob Fitzpatrick

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Starting Access 2010 not solved
    By mrkaye in forum Access
    Replies: 11
    Last Post: 10-12-2011, 02:50 PM
  2. Replies: 3
    Last Post: 08-25-2011, 02:28 PM
  3. Replies: 4
    Last Post: 04-07-2011, 04:38 PM
  4. Access DB issue with autonumber
    By cusfirstadmin in forum Forms
    Replies: 1
    Last Post: 12-02-2010, 10:45 AM
  5. Starting an Access database for a group...
    By kkrishna in forum Access
    Replies: 8
    Last Post: 05-19-2010, 05:29 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums