INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Jobs

Run Delete Query on Linked Sharepoint List

Run Delete Query on Linked Sharepoint List

(OP)
I haven't been able to find anything regarding this out there so hoping someone may be able to help out.
I have a list out on SharePoint that I link back into Access to query and run reports based off off. I have a query that runs to archive these records each month to a table. What I need to do after this archive is done is delete those records from the SharePoint list. I set up a delete query to run based upon the ID within the record but when I go to run the query I am getting an error stating "Could not delete from specified table". Not sure if I just have something wrong within my query or if it is due to being a linked SharePoint list.

DELETE [Tasks].*, [Tasks].ID
FROM [Tasks], [archive 201502]
WHERE ((([Tasks].ID)=[archive 201502]![ID]));

Any help would be great.

Thanks,

RE: Run Delete Query on Linked Sharepoint List

WHat is the table's name you are deleting the records from?
[Tasks] or [archive 201502] or both?

Have fun.

---- Andy

A bus station is where a bus stops. A train station is where a train stops. On my desk, I have a work station.

RE: Run Delete Query on Linked Sharepoint List

(OP)
Deleting from Tasks

RE: Run Delete Query on Linked Sharepoint List

A quick test would be to see if you can edit anything in the linked list.

Also, there is no join in your delete query.

Duane
Hook'D on Access
MS Access MVP

RE: Run Delete Query on Linked Sharepoint List

If you just deleting from Tasks table, your statement should look like:

DELETE FROM Tasks
WHERE ...


So I would try is to delete a specific (hard-coded) ID and see if it would work:

DELETE FROM Tasks
WHERE ID = 1234


Have fun.

---- Andy

A bus station is where a bus stops. A train station is where a train stops. On my desk, I have a work station.

RE: Run Delete Query on Linked Sharepoint List

(OP)
That runs fine the problem I'm having is that I need to delete the items from the archived list. So when I try to reference that table is where I am getting the error stating it cannot delete.

RE: Run Delete Query on Linked Sharepoint List

Try this:

CODE --> SQL

DELETE [Tasks].*
 FROM [Tasks]
 WHERE [Tasks].ID IN (SELECT ID FROM [archive 201502]); 

Duane
Hook'D on Access
MS Access MVP

RE: Run Delete Query on Linked Sharepoint List

(OP)
Worked perfectly.
Thank you,

RE: Run Delete Query on Linked Sharepoint List

Don't forget to click on "Great post? Star it!" link to show appreciation for Duane's help.

Have fun.

---- Andy

A bus station is where a bus stops. A train station is where a train stops. On my desk, I have a work station.

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members!

Resources

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close