View Full Version : Importing data help


alwaysaangel
05-15-2007, 03:28 PM
I'm hoping someone can help me with what (I think) may be a minor oversight by me.

I'm trying to import data from an Excel Spreadsheet into a table that I have already created for my job.

Both the table and the excel spreadsheet have a common factor which is an identification number. I would like to import the data into the existing table so that the additional values fall under the appropriate identification number.

I hope that makes sense - if not let me know and I'll try to explain further.

So my question is - is this possible? I searched the help files and some internet resources and couldn't find anything this very specific kind of importation.

If anyone could help me I would greatly appreciate it as you would save me tons of time.

Thanks in advance!

The_Doc_Man
05-15-2007, 06:49 PM
You can do what you want but probably at the level of precision you seek, it won't be through a wizard. At least not directly. Wizards are great in what they do, but when they dumb-up on you, they are dumber than a box of rocks. Sheesh, what a headache when things go south.

Anyway, a couple of options come to mind, but the one that gives you greatest control is to involve VBA to some degree. You need to assure that you can pick and choose how the import is going to work, which a wizard won't do for you. So I would import the spreadsheets into a temp table before doing anything else. Then it would not be too hard to write some VBA code using recordsets on your main and import tables to do the merging according to your needs.

To prepare for this, look up Recordsets (or more specifically, DAO Recordsets). There are lots of examples that will tell you exactly what to do about adding a new record, updating records, etc.