update or add new excel data to an Access table

meb135

New Member
Joined
Jun 2, 2008
Messages
17
Hi,
I have a table in an excel worksheetsheet that contains data from columns A to Q. In an access database, i have a table that is setup with the exact same fields as in the excel table. The the number of rows in the data sheet is variable. The 1st column in the worksheet contains the unique ID#. It's a 7 digit number.
Here's what i need to do.
Loop through the table in excel and identify the Unique ID# in column "A" and seach the access database to see if that unique ID# already exists. If it exists, then update that record with the data from the excel table. If it doesn't exist, add the new record to the database. then go on to the next row......

I'm using Excel and access 2003.

The database name and location is //S11EC111\Project\db1.mdb and is not in the same location as the excel table.
I've activated the ActiveX Data Objects 2.8 library to use ADO.

Your help would be appreciated.
thanks
Marc
 

Excel Facts

When they said...
When they said you are going to "Excel at life", they meant you "will be doing Excel your whole life".

Forum statistics

Threads
1,224,545
Messages
6,179,432
Members
452,915
Latest member
hannnahheileen

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