Update specific records only

antrawson

New Member
Joined
Jan 4, 2012
Messages
49
Hi all,
I did have an account however I forgot my password and it was my old employers email address *doh*

Anyway, I am looking for some help please on access

I have a table which has a load of columns. There is one column with a unique field and one that has quantity.

How can I using a spreadsheet mass update the records eg I want it to update the quantity field only but for each record with that identifier

It would be easy in excel however the lines change and as such the info on row 244 for example will be different on the next released spreadsheet

Any help would be great
Many thanks
 

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".
update the quantity field only but for each record with that identifier
What identifier? If you mean the unique table id you refer to, there is only one record, otherwise it can't be unique. I think you mean update the table quantity field using the quantity from the spreadsheet where each table id equals the id in the spreadsheet.
You have a couple of options, I guess. If the structure of the table and spreadsheet will not change, then you could use the Transferspreadsheet method to move the spreadsheet data into a table that you link to in an update query that links the tables by id and performs the update using the quantity that you transfered.

Depending on the rest of your data, you could also only transfer the data and over-write the table entirely if that makes sense. You will need a work-around because of the unique table id - maybe deleting the table data first (using transactions would be advised in case the upload fails. You would roll back the delete).

Or you could use automation to open Excel, but this would be more difficult and involve loops that either found a matching id in the spreadsheet or vice-versa
 
Last edited:
Upvote 0
Hi
I will add some more context as it may help

In my table in access Column B is the unique identifier, column F will have a number which is quantity. I will have a spreadsheet which has identical headers as thats in the database. I want to only update the access database with column F against the column B
Does this help a bit?
Thanks
 
Upvote 0
Thanks for clarifying - I think this
I think you mean update the table quantity field using the quantity from the spreadsheet where each table id equals the id in the spreadsheet.
means the same thing. If we agree, my answer was based on that assumption so no changes there. The method you choose would be based on your knowledge/comfort level and business environment. Maybe you need to research "transferspreadsheet" to see if that would work for you. Automation is a different animal.
 
Upvote 0

Forum statistics

Threads
1,221,846
Messages
6,162,378
Members
451,760
Latest member
samue Thon Ajaladin

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