Get the Autonumber field

Results 1 to 5 of 5

Thread: Get the Autonumber field

  1. #1
    Patty Guest

    Default Get the Autonumber field

    Is there a way for me to retreive the autonumber value of a new record that is being inserted int a MsAccess db?<BR>Without doing a:<BR><BR> 1) insert all fields into mytable<BR> 2) then do a search (select) of the record just inserted using, for example, the user telephone # <BR> 3) and get the autonumber of that record <BR><BR>?<BR><BR>Thank you.<BR>

  2. #2
    Persesus Guest

    Default RE: Get the Autonumber field

    what about:<BR><BR>NextRecord = Recordset.RecordCount + 1

  3. #3
    Join Date
    Dec 1969

    Default RE: Get the Autonumber field

    check the FAQ it&#039;s there somewhere....

  4. #4
    Persesus Guest

    Default !! OR !! RE: Get the Autonumber field

    If the autonumber is not full eg 1 - 10 no 11 and 12 - 20<BR>recordcount would equal 19 plus 1 = 20 and 20 exists.<BR><BR>perform a sql of<BR><BR>select MAX(AutoNumberField) + 1 as NextRecord FROM Table<BR><BR>This will do the trick.

  5. #5
    Patty Guest

    Default Does it really effect?

    If I do a select after my Insert statement does it really effect the performance ?<BR><BR>

Posting Permissions

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