Results 1 to 2 of 2
  1. #1
    1953hogan is offline Novice
    Windows 7 32bit Access 2007
    Join Date
    Jun 2011
    Posts
    10

    Problem with primary key on imported database

    Hello,



    I am teaching myself Access after years of working with Lotus Approach. I am creating a Customer database in access after importing tables from Approach. I have a table called "Customers" that had existing data and have set the primary key to "customerID" which is the same field that was used in Approach.

    This customerID field needs to auto number and increment by 1 each time a new customer record is entered, but when I try to change the field to autonumber, I get this message: "Once you enter data in a table, you can't change the data type of any field to autoNumber..."

    I really don't want to recreate thousands of customer records because the customerID is used in relationships with other tables as well.

    How can I use my existing ID field and get it to autonumber when a new record is added?

    Thanks very much,

    Steve

  2. #2
    TheShabz is offline Court Jester
    Windows XP Access 2003
    Join Date
    Feb 2010
    Posts
    1,368
    I dont think you can. You would probably fake an autonum field by setting the default value to DMax(fieldname As String, TableName As String) +1

    Not 100% sure though.

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

Similar Threads

  1. Editing Primary Key in Split Database
    By jaypoppin in forum Access
    Replies: 10
    Last Post: 03-16-2011, 10:39 AM
  2. Imported Named Range
    By jgelpi16 in forum Programming
    Replies: 4
    Last Post: 03-04-2011, 10:03 AM
  3. Populate primary key into imported tables
    By Edigo in forum Import/Export Data
    Replies: 0
    Last Post: 03-16-2010, 09:17 PM
  4. database structure:primary key debate
    By MUKUDU99 in forum Database Design
    Replies: 0
    Last Post: 08-19-2008, 12:20 AM
  5. Help with imported data
    By bubbasheeko in forum Queries
    Replies: 0
    Last Post: 01-12-2007, 07:12 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