Solved

DoCmd.TransferSpreadsheet adding an autonumber field

Posted on 2008-06-11
1
681 Views
Last Modified: 2008-06-12
Hi

I am using the DoCmd.TransferSpreadsheet function to import data into access. Is there a way to create a new field in the imported table called ID that is an autonumber and a primary key within the vba?

Thanks
0
Comment
Question by:Ellis_F
1 Comment
 
LVL 46

Accepted Solution

by:
tbsgadi earned 500 total points
ID: 21759729
Hi Ellis_F,

The easiest way is to create the table in Access (with an autonumber) & import into that table. (If necessary deleting previous data.


Good Luck!

Gary
0

Featured Post

Migrating Your Company's PCs

To keep pace with competitors, businesses must keep employees productive, and that means providing them with the latest technology. This document provides the tips and tricks you need to help you migrate an outdated PC fleet to new desktops, laptops, and tablets.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
hit enter key to run macro 13 25
Solved: How can I prevent deletions from a form in datasheet view? 5 28
backup programme - VBA 3 24
Export to Excel 7 17
When you are entering numbers in a speadsheet, and don't remember what 6×7 is, you just type “=6*7" instead. It works in every cell! This is not so in Access. To enter the elusive 42 in a text box, you have to find a calculator, and then copy the re…
Describes a method of obtaining an object variable to an already running instance of Microsoft Access so that it can be controlled via automation.
Learn how to number pages in an Access report over each group. Activate two pass printing by referencing the pages property: Add code to the Page Footers OnFormat event to capture the pages as there occur for each group. Use the pages property to …
What’s inside an Access Desktop Database. Will look at the basic interface, Navigation Pane (Database Container), Tables, Queries, Forms, Report, Macro’s, and VBA code.

825 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question