Results 1 to 5 of 5
  1. #1
    Join Date
    Dec 2003
    Posts
    5

    Question Unanswered: How do you add 1 with each new record without using autonumber? Please help!

    The equivalent of Excel 1+previous cell, never used the expression builder and need a point in the right direction

  2. #2
    Join Date
    Oct 2003
    Location
    Ger
    Posts
    1,969
    Provided Answers: 1

    Lightbulb Re: How do you add 1 with each new record without using autonumber? Please help!

    Originally posted by Fraser2000
    The equivalent of Excel 1+previous cell, never used the expression builder and need a point in the right direction
    Do you want to do that on enter an new record? I seems difficult, but you can Export your Table to Excel, do that ther per AutoFill the Import it again, you can do it manually or programtticaly.
    [Just an Idea]

  3. #3
    Join Date
    Dec 2003
    Posts
    5
    I've imported from Excel but the spreadsheet starts from 100001. What's the program to add1 for each new record?

  4. #4
    Join Date
    Nov 2003
    Location
    LONDON
    Posts
    238
    Originally posted by Fraser2000
    I've imported from Excel but the spreadsheet starts from 100001. What's the program to add1 for each new record?
    Use a SQL statement to add 1. First you need to find the last number entered use the following code:

    Dim lngMaxRecord As Long

    ' Fetch the highest number from your table and add 1 to it
    lngMaxRecord = DMax("MyRecordNumberField", "MyTable") + 1

    You can then use this variable on your form or in an INSERT SQL statement to add a new record

  5. #5
    Join Date
    Dec 2003
    Posts
    5
    Thanks for your help Justin, will give it a go.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •