Access DB - Macro to Delete and Replace Table with Excel File (Sharepoint List)

squeakums

Well-known Member
Joined
May 15, 2007
Messages
823
Office Version
  1. 365
I brought in two tables into an Access DB from a linked Sharepoint list and I am working on deleting all data and replacing with an updated excel file. There data is rather large so this is a bulk update. I have some code that deletes the table although doesn't seem to delete all and I need to run it several times. Do you have a written code that I can use that can delete a table all the way through and then replace with an excel file that has the updated data?
 

Excel Facts

Copy a format multiple times
Select a formatted range. Double-click the Format Painter (left side of Home tab). You can paste formatting multiple times. Esc to stop
I have some code that deletes the table although doesn't seem to delete all
You must mean delete the table records. If you use sql or code to delete (Drop) table, it is gone. There is no such thing as running any query against it again.
Maybe what you're looking for is like
DELETE * FROM myTable;

Why not just create a delete query in design view? If you need help with sql, post what you have that doesn't seem to be doing what you want.
Warning: You should test such sql statements or vba code on a copy of your table(s). If you use any delete sql or code provided in a forum (at least that which I might provide) and it causes unexpected loss on your real data, you're on your own after that.
 
Upvote 0

Forum statistics

Threads
1,215,046
Messages
6,122,855
Members
449,096
Latest member
Erald

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