autonumber insert question...

Results 1 to 2 of 2

Thread: autonumber insert question...

  1. #1
    Join Date
    Dec 1969

    Default autonumber insert question...

    Hello all.<BR><BR>I haven&#039;t programmed in awhile using Access, and I am curious, when you do an insert from a form into an access db table, and the records are kept track with an autonumber, how do you complete the insert for that autonumber. For example, I am adding a first and last name. This is the first record ever added to the table, so how would I account for the autonumber?<BR><BR>sql = insert into TABLE (ID_NUMBER, FIRST_NAME, LAST_NAME) "<BR>sql = sql & "values (" & WHAT IS THE VALUE FOR THE AUTONUMBER GOING TO BE???? & ","&#039; & request("first_name") & "&#039;,&#039;" & request("last_name") & "&#039;)"<BR><BR>Do I need to query the table and see what number is the max autonumber and simply add 1 to that and then add to the table...etc. That sounds pretty inefficient. Any help would be great! Thanks.<BR><BR>rob

  2. #2
    Join Date
    Dec 1969

    Default You don't.

    Access does<BR>sql = insert into TABLE (FIRST_NAME, LAST_NAME) "<BR>sql = sql & "values ("&#039; & request("first_name") & "&#039;,&#039;" & request("last_name") & "&#039;)"<BR>See FAQ 79

Posting Permissions

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