By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
435,254 Members | 2,491 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 435,254 IT Pros & Developers. It's quick & easy.

Access error to specify table on Delete query

P: n/a
I'm getting an error on the following delete query, which says to "specify
the table containing the records you want to delete." Here's the delete
action query

sSQL = "DELETE * FROM [BACKUP_TABLE] As A LEFT JOIN [MAIN_TABLE] AS B ON" & _
" (A.FIELD1 = B.FIELD1 AND A.FIELD2 = B.FIELD2 AND A.FIELD3 = B.FIELD3)"
& _
" WHERE B.FIELD1 Is Null AND B.FIELD2 Is Null AND B.FIELD3 Is Null;"
I'm trying to delete records from the backup table that no longer exist in
the main table. These tables have three fields that makeup the primary key.

Thanks.

--
Message posted via http://www.accessmonster.com

Dec 18 '06 #1
Share this Question
Share on Google+
1 Reply


P: n/a
Figured out the solution.

I need to have:

sSQL = "DELETE A.*...........

rdemyan wrote:
>I'm getting an error on the following delete query, which says to "specify
the table containing the records you want to delete." Here's the delete
action query

sSQL = "DELETE * FROM [BACKUP_TABLE] As A LEFT JOIN [MAIN_TABLE] AS B ON" & _
" (A.FIELD1 = B.FIELD1 AND A.FIELD2 = B.FIELD2 AND A.FIELD3 = B.FIELD3)"
& _
" WHERE B.FIELD1 Is Null AND B.FIELD2 Is Null AND B.FIELD3 Is Null;"

I'm trying to delete records from the backup table that no longer exist in
the main table. These tables have three fields that makeup the primary key.

Thanks.
--
Message posted via AccessMonster.com
http://www.accessmonster.com/Uwe/For...ccess/200612/1

Dec 18 '06 #2

This discussion thread is closed

Replies have been disabled for this discussion.