Excel To MDB

V

VBA

Hi
I Export Empty MDB table to Excel with this command
DoCmd.OutputTo

Now I get this XLS file with new rows that I need append to my MDB Table
What is the ways to do it?

What I do now...
I check MDB tables Fields for their type generate INSERT SQL statement With
data from XLS
And run SQL

Maybe some body know other ways?
 
V

VBA

What About Autonumber Field


Ken Snell said:
You can use the TransferSpreadsheet action to import data from EXCEL into
ACCESS table.

Or you can link to the EXCEL spreadsheet and run an append query to copy the
data from the spreadsheet to the ACCESS table.
 
V

VBA

I Use

DoCmd.OutputTo
And after that user fill XLS table he puts values to the fields with
autoincriment attributes

If I try use

TransferSpreadsheet

Access gives me error because I try write not null values to AutoNumber
field
 
V

VBA

Hi
U not understand
Tranfer spreadsheet not help me
i can't run this query
db.Execute "INSERT INTO table1 SELECT * FROM table2", dbFailOnError
because tables have autonumber field
and i get error
"You tried to assign the Null value to a variable that is not a variant data
type"







----- Original Message -----
From: "Ken Snell" <[email protected]>
Newsgroups: microsoft.public.access.modulesdaovba.ado
Sent: Sunday, August 10, 2003 2:53 PM
Subject: Re: Excel To MDB
 
K

Ken Snell

An EXCEL file that is linked as a table won't have an autonumber field. I am
sorry, but I am not sure what you have tried to do here. What is table1?
what is table2?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top