Importing from excel to access, multiple tables

giddyup43

New Member
Joined
Dec 3, 2015
Messages
29
Hi.
I receive an excel file every day that I would like to append to my tables in access. It needs to be split into a few tables:
Orders, Transactions and Customers.
I couldn't do it via append query because of the primary keys. I have Order Numbers set up to be the Primary Key in the Orders table, I have transaction number set up to be the primary key in the transaction table and customer email to be the primary key in the customers table.
Access will not let me import my columns when these primary keys are set up.

Is there any way to do it?
Please let me know.
Thanks!
 

Excel Facts

Using Function Arguments with nested formulas
If writing INDEX in Func. Arguments, type MATCH(. Use the mouse to click inside MATCH in the formula bar. Dialog switches to MATCH.
Is the problem that you have duplicate keys you are trying to append? If so, how do you want to deal with the duplicates?
 
Upvote 0
Let me suggest using Excel Automation from MSAccess. Put Excel in a specific folder with a sub-folder of "imported"
With automaiton, Access can open the Excel, import it, then move the Excel to the sub-folder "imported"
Typically, I import the Excel into a Staging Table. A local Access table that just has an autocounter and basically imports the data.
Once the data is in the Local Table - it can be processed as needed.

As xenou mentioned, does your data have a column or other indicator that makes Orders or Transactions different?
For example: are orders on one tab of an Excel workbook and transactions on a different tab?
A primary key can consist of two fields if needed.
It will depend on your plan to deal with the ID for each category (Orders, Transactions, ... other).

If you are really new to Access, take a look at Sample Databases - Access World Forums
There are around 400 sample databases that are free to download. A couple are my own. A recent addition is importing Invoices might give you some ideas.
Just to give you an idea, here is just one example: Import Multiple Spreadsheets - Access World Forums
This example shows how to use the file dialog picker to select multiple Excel files for importing into new Access tables. This can of course be expanded upon to suit different needs, but the base idea is probably here.

Once you get a working example, ask questions about modification to suit your specific need. :cool:
 
Upvote 0

Forum statistics

Threads
1,221,827
Messages
6,162,202
Members
451,752
Latest member
freddocp

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top