Results 1 to 2 of 2
  1. #1
    LAazsx is offline Advanced Beginner
    Windows 7 Access 2010 (version 14.0)
    Join Date
    Nov 2010
    Posts
    30

    Inserting records into tables with autonumber

    Hi, how do i enter data into tables with columns which have datatypes of Autonumber?

    Here is the code column that has a datatype autonumber when i created it in SQL Management Studio
    Code:
    CaseNumber int IDENTITY(1,1) NOT NULL PRIMARY KEY
    When I imported the tables into Access, the column CaseNumber was set to Autonumber. I've done some research but I can't get it to work.

    What I found goes like this:
    INSERT INTO (col2,col3) values ('value2','value3');
    col1 needs not to be included because it is autonumber.

  2. #2
    ajetrumpet is offline VIP
    Windows Vista Access 2007
    Join Date
    Mar 2010
    Location
    N/A
    Posts
    2,694
    when you perform an append query like that, access will throw an error if you try to append an actual value, regardless of the source, into the autonumber field. don't append anything. it will increment on it's own.

    what exactly is not working?

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

Similar Threads

  1. Inserting multiple records into a table
    By New2Access in forum Programming
    Replies: 1
    Last Post: 07-07-2011, 09:18 PM
  2. Move records between tables
    By rogueakula in forum Access
    Replies: 1
    Last Post: 04-09-2010, 12:35 PM
  3. Exporting tables containing autonumber keys
    By kgash in forum Import/Export Data
    Replies: 0
    Last Post: 06-21-2009, 01:49 PM
  4. Replies: 0
    Last Post: 05-14-2009, 12:34 AM
  5. Appending Records to tables with relationships
    By RubberStamp in forum Import/Export Data
    Replies: 0
    Last Post: 12-14-2008, 06:52 AM

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