Import specific columns in excel to access table using button

Hansi

New member
Local time
Today, 16:54
Joined
Jun 4, 2018
Messages
8
Hi! How can I import data from excel to existing table in access using button?

User is selecting the excel file from windows explorer and I want to program to enter only some columns to access table. And I am inserting date from form too.
 
Try googling DoCmd.TransferSpreadsheet , this will give you a good start.
 
Alternatively, add the Excel spreadsheet as a linked table.
Run an append query to add the fields you want to your Access table.
This can be done from your button code.
Include the date field as part of your query setting the value to that on your form control
 
Isn't DoCmd.TransferSpreadsheet import all the fields? I don't want all and the columns that I want are not in order.
 
That's one reason why I suggested the other approach.
 

Users who are viewing this thread

Back
Top Bottom