Importing and Field Mapping (excel to access)

dunlop407703

New Member
Joined
Oct 8, 2014
Messages
24
Hi all,

I am currently in the process of importing a large back catalog of excel data into access so it can be managed better. The problem I have is that the excel field names do not match the access table field names, and more so the excel field names vary with nearly every excel sheet (very poor data control previously).

I have searched around and apparently there is no native way in access to map fields on import, if there is please tell me but I haven't been able to find a way.

What I have come across is a suggestion to import the data into a temporary new table, then use an append query to move the data into the correct table, followed by deleting the temporary new table. In theory this process makes sense to me however how to put it into practice is beyond me. Also I'm not sure but if this was the process would I have to re-write the append query to match the different field headers coming in every time, or can I map as I go with an append query?

What I envisage is a button on my main form to import data. When I hit it I get a select file dialog box, I select my file and it imports into a new table, the append querry automatically runs and appends the data to the write table, then another function runs to delete the temporary 'go between' table.

I have no idea how much / if any of this is possible, nut any feedback or discussion would be appreciated.

Cheers
 

Excel Facts

How to total the visible cells?
From the first blank cell below a filtered data set, press Alt+=. Instead of SUM, you will get SUBTOTAL(9,)
Hi all,

I am currently in the process of importing a large back catalog of excel data into access so it can be managed better. The problem I have is that the excel field names do not match the access table field names, and more so the excel field names vary with nearly every excel sheet (very poor data control previously).

I have searched around and apparently there is no native way in access to map fields on import, if there is please tell me but I haven't been able to find a way.

What I have come across is a suggestion to import the data into a temporary new table, then use an append query to move the data into the correct table, followed by deleting the temporary new table. In theory this process makes sense to me however how to put it into practice is beyond me. Also I'm not sure but if this was the process would I have to re-write the append query to match the different field headers coming in every time, or can I map as I go with an append query?

What I envisage is a button on my main form to import data. When I hit it I get a select file dialog box, I select my file and it imports into a new table, the append querry automatically runs and appends the data to the write table, then another function runs to delete the temporary 'go between' table.

I have no idea how much / if any of this is possible, nut any feedback or discussion would be appreciated.

Cheers

Well you beat me to this weeks Mr Excel post.

I am having the same issue. I have a table that I created with the first import of a report from my client. The issue is that the # of fields change every month (growing and shrinking ::SMH) as well as new field names appearing at random months and old ones coming and going. Unfortunately, the client knows and is not doing anything to standardize the uploads.

My question, which might be what the OP is asking or might help them is:

Is there a way to upload the file to a temp table and then have vba match fields with the same name, and ADD fields that do not exist?

IF this solution is not along the OPs possible solutions, then I will gladly make a new thread. I do not want to hijack this thread. I posted as I thought my question and the OPs were similar enough that either question being answered would probably solve both issues.
 
Upvote 0
I would prefer to change column names in Excel as that is much simpler than changing field names in Access. Then import. Either way, it really depends on how much variability you are talking about - this might be easy or very hard.
 
Upvote 0
I would prefer to change column names in Excel as that is much simpler than changing field names in Access. Then import. Either way, it really depends on how much variability you are talking about - this might be easy or very hard.

Thanks for the reply xenou, I've just bitten the bullet and made a few field name changes to my database and then started to manually go through the excel files and update.
 
Upvote 0
Looks like OP as solved his issue, so instead of hi-jacking this thread I will start another.
 
Upvote 0

Forum statistics

Threads
1,214,911
Messages
6,122,195
Members
449,072
Latest member
DW Draft

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