Importing file

S

Shirley

I want to import a file (TXT or Excel format) to Access.
The field name in the file is different from the name I
set up in the Access table. How can I automatically
convert the name and import the data to my database using
VBA?

Thanks,

Shirley
 
K

Ken Snell

You need to provide a bit more info....which name is in the table? which
name needs to be changed? Show examples of what you want to do.
 
G

Guest

For example, the field name in the excel file that I need
to import from is "Inventory number", the field name in
the table that I need to import to is "PhoneNumber". How
can import the data in "inventory number" in excel to the
field in "PhoneNumber" in Access Table?

Thanks,

Shirley
 
K

Ken Snell

One way is to create a temporary table, import the EXCEL spreadsheet into
the temporary table (using TransferSpreadsheet), use an append query to copy
the desired data from the temporary table into the permanent table, and then
run delete query to remove the data from the temporary table.

Another way is to link to the EXCEL spreadsheet, and run an append query to
copy the dat (as above).

If you can provide more about your setup (do you know the filename, is this
a one-time only action, etc.), I can get into the specifics of these
methods.
 

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