Results 1 to 2 of 2
  1. #1
    Join Date
    Sep 2002
    Posts
    5

    Unanswered: Resetting primary key

    I know this is probably straight forward but...

    I am setting up a procedure that effectively removes the contents of a table and then replaces it with an import from Excel, I am doing this via a simple Macro. However, I would like to reset the primary key to 1 when the new data is imported.

    What is the code for this?

    Thanks

  2. #2
    Join Date
    Jul 2002
    Location
    Australia
    Posts
    147
    Firstly, there are heaps of code examples on the net to do this. Go to http://www.google.com and search for "reset primary key".

    Secondly, why do you want to do this? It shouldn't matter what the primary key is. As a rule of thumb, they should never be seen. They are there to uniquely identify records for relationships.. Nothing more, nothing less.

    If you need a field for presentation then I suggest you create separate 'stand-alone' field.

    Cheers,
    Andrew
    There have been many posts made throughout the world.
    This was one of them.

Posting Permissions

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