A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Running & Setting Up Queries
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Delete Query Cannot delete from specified tables



 
 
Thread Tools Display Modes
  #1  
Old June 27th, 2008, 08:55 PM posted to microsoft.public.access.queries
ken957
external usenet poster
 
Posts: 7
Default Delete Query Cannot delete from specified tables

I have a very long table using a limited number of company names, I have
another long table with many of the same or similar company names. I wanted
to make a table without duplicates of the the company names used in the first
table, then work on establishing relationships with the names from the second
table.

I made a table with only three fields, autonumber, CompanyNameListA,
CompanyNameListB. I pasted all 20,000 plus companynames from listA, made a
totals query grouping on company name and using MinOf the autonumber field.

My delete query correctly displays the records I want to delete but only
gives the "cannot delete from specified tables" error

The only relationship between any tables/querys is between company names
from ListA and the Totals Query


--
ken
  #2  
Old June 27th, 2008, 09:06 PM posted to microsoft.public.access.queries
Duane Hookom
external usenet poster
 
Posts: 7,177
Default Delete Query Cannot delete from specified tables

Any query that contains GROUP BY in it or one of its sources is not
updateable. I generally create a table based on the GROUP BY query and then
define its primary key. Use this new query in place of your totals query.

--
Duane Hookom
Microsoft Access MVP


"ken957" wrote:

I have a very long table using a limited number of company names, I have
another long table with many of the same or similar company names. I wanted
to make a table without duplicates of the the company names used in the first
table, then work on establishing relationships with the names from the second
table.

I made a table with only three fields, autonumber, CompanyNameListA,
CompanyNameListB. I pasted all 20,000 plus companynames from listA, made a
totals query grouping on company name and using MinOf the autonumber field.

My delete query correctly displays the records I want to delete but only
gives the "cannot delete from specified tables" error

The only relationship between any tables/querys is between company names
from ListA and the Totals Query


--
ken

  #3  
Old June 27th, 2008, 09:09 PM posted to microsoft.public.access.queries
ken957
external usenet poster
 
Posts: 7
Default SQL of above

This is the SQL of my post. I changed MinOf to FirstOf but same result


DELETE CompanyNamesCompare.*, CompanyNamesCompare.IBAMAT_Company,
CompanyNamesCompare.ID, CompanyNamesCompare.ID
FROM CompanyNamesCompare INNER JOIN NodupsIBcompany AS DDD ON
CompanyNamesCompare.IBAMAT_Company = DDD.IBAMAT_Company
WHERE (((CompanyNamesCompare.IBAMAT_Company)=[DDD].[IBAMAT_Company]) AND
((CompanyNamesCompare.ID)[DDD].[FirstOfID] And
(CompanyNamesCompare.ID)200));

--
ken


  #4  
Old June 27th, 2008, 09:48 PM posted to microsoft.public.access.queries
ken957
external usenet poster
 
Posts: 7
Default same error

I made a new table pasted in the records of unique company names and still
get the cannot delete from specified tables
--
ken


"ken957" wrote:

This is the SQL of my post. I changed MinOf to FirstOf but same result


DELETE CompanyNamesCompare.*, CompanyNamesCompare.IBAMAT_Company,
CompanyNamesCompare.ID, CompanyNamesCompare.ID
FROM CompanyNamesCompare INNER JOIN NodupsIBcompany AS DDD ON
CompanyNamesCompare.IBAMAT_Company = DDD.IBAMAT_Company
WHERE (((CompanyNamesCompare.IBAMAT_Company)=[DDD].[IBAMAT_Company]) AND
((CompanyNamesCompare.ID)[DDD].[FirstOfID] And
(CompanyNamesCompare.ID)200));

--
ken


  #5  
Old June 28th, 2008, 01:54 AM posted to microsoft.public.access.queries
Duane Hookom
external usenet poster
 
Posts: 7,177
Default same error

Did you "... then define its primary key ..." after creating the table?

--
Duane Hookom
Microsoft Access MVP


"ken957" wrote:

I made a new table pasted in the records of unique company names and still
get the cannot delete from specified tables
--
ken


"ken957" wrote:

This is the SQL of my post. I changed MinOf to FirstOf but same result


DELETE CompanyNamesCompare.*, CompanyNamesCompare.IBAMAT_Company,
CompanyNamesCompare.ID, CompanyNamesCompare.ID
FROM CompanyNamesCompare INNER JOIN NodupsIBcompany AS DDD ON
CompanyNamesCompare.IBAMAT_Company = DDD.IBAMAT_Company
WHERE (((CompanyNamesCompare.IBAMAT_Company)=[DDD].[IBAMAT_Company]) AND
((CompanyNamesCompare.ID)[DDD].[FirstOfID] And
(CompanyNamesCompare.ID)200));

--
ken


 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 06:14 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.