Solved

DoCmd.TransferSpreadsheet adding an autonumber field

Posted on 2008-06-11
1
673 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

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…
I originally created this report in Crystal Reports 2008 where there is an option to underlay sections. I initially came across the problem in Access Reports where I was unable to run my border lines down through the entire page as I was using the P…
In Microsoft Access, learn how to use Dlookup and other domain aggregate functions and one method of specifying a string value within a string. Specify the first argument, which is the expression to be returned: Specify the second argument, which …
With Microsoft Access, learn how to start a database in different ways and produce different start-up actions allowing you to use a single database to perform multiple tasks. Specify a start-up form through options: Specify an Autoexec macro: Us…

914 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

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now