oh Another Importing Question

airforceone

Board Regular
Joined
Feb 14, 2022
Messages
177
Office Version
  1. 2019
  2. 2016
Platform
  1. Windows
This is killing me!

I have A MS Access Program that works well (I think) importing, exporting and everything…

The problem is the new branch in charge of IT solution implemented a dynamic column/fields insertion per location. Now for argument sake, lets say it will stay that way (dynamic insertion of column/fields) and we cannot do anything about it.

My query is:

Can I preselect columns/fields Excel table prior to importing (I know there is none – except importing to temp Table is still the way AFAIK)

Can I import Excel table and dynamically create new column/fields in the TARGET TABLE (MS ACCESS) based on the Excel Table

Is it more efficient if I merge excel spreadsheet (4 Sheet in 3 workbook) before importing or should I import first to TEMP TABLE in MS Access then Merge before appending to Master Table

Book1
ABCDEFGHIJKLM
1MS Access (Target Table)Excel (To Import)
2BnoNameAddressBSCodeDate EnteredBnoNameAddressBSCodeDate EnteredExit DateESCode
3A00001JohnSan FranciscoA002022.01.01A00001JohnSan FranciscoA002022.01.012022.02.01A00
4A00002MikeTexasA012022.02.01A00002MikeTexasA012022.02.012022.03.01A02
5A00003RussNew YorkA012022.02.01A00003RussNew YorkA012022.02.012022.03.01A02
6A00004PeterLas VegasA022022.03.01A00004PeterLas VegasA022022.03.012022.04.01A03
7A00005MeyerUtahA032022.04.01A00005MeyerUtahA032022.04.012022.05.01A04
8A00006AustineCamarilloA002022.01.01A00006AustineCamarilloA002022.01.012022.02.01A04
Sheet1
 

Excel Facts

Format cells as time
Select range and press Ctrl+Shift+2 to format cells as time. (Shift 2 is the @ sign).
I am pretty sure that you cannot automatically add new columns to an existing Access table through the ordinary/standard importing methods. I think you would need to use VBA to first identify and add those new columns to the table before you even consider importing the data. To be honest, I have never done anything like that. I usually do not try to mess with Table structure via VBA.

If you do not actually need the new data in Access, then I would probably import to a temp table, and then do an Append Query from the temp table to the final table.
Or maybe create an Excel macro that gets rid of the extra new columns before exporting/importing into Access.

If you do need to import any/all new columns into Access, this is probably going to be a problem. In well-designed Access databases, the table structures are typically pretty stable. You should seldom be changing the fields in tables. Constantly changing tables are really not conducive to a well-designed, efficient Access database.
 
Upvote 0
I am pretty sure that you cannot automatically add new columns to an existing Access table through the ordinary/standard importing methods. I think you would need to use VBA to first identify and add those new columns to the table before you even consider importing the data. To be honest, I have never done anything like that. I usually do not try to mess with Table structure via VBA.

If you do not actually need the new data in Access, then I would probably import to a temp table, and then do an Append Query from the temp table to the final table.
Or maybe create an Excel macro that gets rid of the extra new columns before exporting/importing into Access.

If you do need to import any/all new columns into Access, this is probably going to be a problem. In well-designed Access databases, the table structures are typically pretty stable. You should seldom be changing the fields in tables. Constantly changing tables are really not conducive to a well-designed, efficient Access database.
yeah I couldn't agree more! what pains me is they sometimes change the existing field name not just add new one!
I guess there's no workaround but to preselect Excel Column/Fields prior to Importing!
anyway thanks mate, it's just I'm trying to shoot my foot here :)
 
Upvote 0
wait mate just one more crazy idea, is there a way to present column/fields in Access?
what I mean is opening table and then selecting fields on the fly for use?
lets say I have a Car Table opening that Table then I'll preselect (by way of check box) needed fields? well just asking... :)
 
Upvote 0
wait mate just one more crazy idea, is there a way to present column/fields in Access?
what I mean is opening table and then selecting fields on the fly for use?
lets say I have a Car Table opening that Table then I'll preselect (by way of check box) needed fields? well just asking... :)
I have never heard of such a thing.
 
Upvote 0
You could make a multi select listbox that has the Field List as it's source Type?
Then build your SQL accordingly.
If you want to add/amend fields in the DB and they are NOT in the FE, then you will need to do that in the BE.

Lost of work to get correct TBH.
 
Upvote 0
You could make a multi select listbox that has the Field List as it's source Type?
Then build your SQL accordingly.
If you want to add/amend fields in the DB and they are NOT in the FE, then you will need to do that in the BE.

Lost of work to get correct TBH.
hmm interesting, I could try that out
Load the column/fields in a listbox and multiselect fields that will be imported to MASTER DB! sounds fun I just hope I can do it! :) ciao
 
Upvote 0

Forum statistics

Threads
1,213,546
Messages
6,114,256
Members
448,557
Latest member
richa mishra

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