Importing file

  • Thread starter Thread starter Shirley
  • Start date Start date
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
 
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.
 
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
 
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.
 
Back
Top