Having trouble getting DELETE Query to work...

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

This is giving me the error: "Could not delete from specified tables."

Little help?

DELETE Parts_Detail.['ID'], Parts_Detail.*
FROM Parts_Detail, Query4
WHERE (((Parts_Detail.['ID'])=[Query4]!['ID']));
 
First make back up for your data, there will be no return

In the Query join the table and the query, instead of creating a criteria

DELETE Parts_Detail.*
FROM Parts_Detail INNER JOIN Query4 ON Parts_Detail.['ID'] = Query4.['ID']

For future reference you should try and avoid names that includes quotes
 
Steven said:
This is giving me the error: "Could not delete from specified tables."

Little help?

DELETE Parts_Detail.['ID'], Parts_Detail.*
FROM Parts_Detail, Query4
WHERE (((Parts_Detail.['ID'])=[Query4]!['ID']));


I don't understand your syntax for the ID field, but
normally it would just be:

DELETE Parts_Detail.*
FROM Parts_Detail INNER JOIN Query4
ON Parts_Detail.ID = Query4.ID
 
I have done as you suggested and if I switch to Datasheet view I can see the
27 records I want to delete. But when I hit the ! for run I get the same
error???

Further Ideas?

Ofer said:
First make back up for your data, there will be no return

In the Query join the table and the query, instead of creating a criteria

DELETE Parts_Detail.*
FROM Parts_Detail INNER JOIN Query4 ON Parts_Detail.['ID'] = Query4.['ID']

For future reference you should try and avoid names that includes quotes

--
Please respond to the group if your question been answered or not, so other
can refer to it.
Thank you and Good luck



Steven M. Britton said:
This is giving me the error: "Could not delete from specified tables."

Little help?

DELETE Parts_Detail.['ID'], Parts_Detail.*
FROM Parts_Detail, Query4
WHERE (((Parts_Detail.['ID'])=[Query4]!['ID']));
 
Can you post your SQL?

Try and change it to
DELETE DISTINCTROW Parts_Detail.*
FROM Parts_Detail INNER JOIN Query4 ON Parts_Detail.['ID'] = Query4.['ID']


--
Please respond to the group if your question been answered or not, so other
can refer to it.
Thank you and Good luck



Steven M. Britton said:
I have done as you suggested and if I switch to Datasheet view I can see the
27 records I want to delete. But when I hit the ! for run I get the same
error???

Further Ideas?

Ofer said:
First make back up for your data, there will be no return

In the Query join the table and the query, instead of creating a criteria

DELETE Parts_Detail.*
FROM Parts_Detail INNER JOIN Query4 ON Parts_Detail.['ID'] = Query4.['ID']

For future reference you should try and avoid names that includes quotes

--
Please respond to the group if your question been answered or not, so other
can refer to it.
Thank you and Good luck



Steven M. Britton said:
This is giving me the error: "Could not delete from specified tables."

Little help?

DELETE Parts_Detail.['ID'], Parts_Detail.*
FROM Parts_Detail, Query4
WHERE (((Parts_Detail.['ID'])=[Query4]!['ID']));
 
I´m having the same problem.
I have one table I want to delete from, and another containing the ID:s of
the rown I want to delete. I've made a simple join (so only ID:s preset in
both tables will be included). It works fine in prewiew, but won´t delete,
returning the same error message as for Steven.

Are there any specific criteria the tables must/musn't fulfil in order for
rows to be deleted? Anything reguarding connections to other tables or types
of data in the table?

And where do I find the SQL when running a simpla query like this, which you
asked Steven to post?

Thanks!
/Johanna



"Ofer" skrev:
Can you post your SQL?

Try and change it to
DELETE DISTINCTROW Parts_Detail.*
FROM Parts_Detail INNER JOIN Query4 ON Parts_Detail.['ID'] = Query4.['ID']


--
Please respond to the group if your question been answered or not, so other
can refer to it.
Thank you and Good luck



Steven M. Britton said:
I have done as you suggested and if I switch to Datasheet view I can see the
27 records I want to delete. But when I hit the ! for run I get the same
error???

Further Ideas?

Ofer said:
First make back up for your data, there will be no return

In the Query join the table and the query, instead of creating a criteria

DELETE Parts_Detail.*
FROM Parts_Detail INNER JOIN Query4 ON Parts_Detail.['ID'] = Query4.['ID']

For future reference you should try and avoid names that includes quotes

--
Please respond to the group if your question been answered or not, so other
can refer to it.
Thank you and Good luck



:

This is giving me the error: "Could not delete from specified tables."

Little help?

DELETE Parts_Detail.['ID'], Parts_Detail.*
FROM Parts_Detail, Query4
WHERE (((Parts_Detail.['ID'])=[Query4]!['ID']));
 
OK - found how to see the SQL.
The one I made looks like this:

DELETE Pres.*
FROM Pres INNER JOIN Bort ON Pres.[Sample-ID] = Bort.[Sample-ID];

Where [Pres] is the one to delete from and [Bort] are the rows to delete.
"Sample-ID" is the column with the ID, connecting the two tables.

/Johanna

"Johanna" skrev:
I´m having the same problem.
I have one table I want to delete from, and another containing the ID:s of
the rown I want to delete. I've made a simple join (so only ID:s preset in
both tables will be included). It works fine in prewiew, but won´t delete,
returning the same error message as for Steven.

Are there any specific criteria the tables must/musn't fulfil in order for
rows to be deleted? Anything reguarding connections to other tables or types
of data in the table?

And where do I find the SQL when running a simpla query like this, which you
asked Steven to post?

Thanks!
/Johanna



"Ofer" skrev:
Can you post your SQL?

Try and change it to
DELETE DISTINCTROW Parts_Detail.*
FROM Parts_Detail INNER JOIN Query4 ON Parts_Detail.['ID'] = Query4.['ID']


--
Please respond to the group if your question been answered or not, so other
can refer to it.
Thank you and Good luck



Steven M. Britton said:
I have done as you suggested and if I switch to Datasheet view I can see the
27 records I want to delete. But when I hit the ! for run I get the same
error???

Further Ideas?

:

First make back up for your data, there will be no return

In the Query join the table and the query, instead of creating a criteria

DELETE Parts_Detail.*
FROM Parts_Detail INNER JOIN Query4 ON Parts_Detail.['ID'] = Query4.['ID']

For future reference you should try and avoid names that includes quotes

--
Please respond to the group if your question been answered or not, so other
can refer to it.
Thank you and Good luck



:

This is giving me the error: "Could not delete from specified tables."

Little help?

DELETE Parts_Detail.['ID'], Parts_Detail.*
FROM Parts_Detail, Query4
WHERE (((Parts_Detail.['ID'])=[Query4]!['ID']));
 
(This quetsion might be added twice - it didn´t appear after the first time I
wrote it)

I found the SQL, and it goes like this:

DELETE Pres.*
FROM Pres INNER JOIN Stream_ID ON Pres.[Lake-ID] = Stream_ID.[Lake-ID];

Where Pres is the table to delete from and Stream_ID is the table containing
the rows that sould be deleted from Pres.
Lake-ID is the common ID connecting the two tables.

/J



"Johanna" skrev:
I´m having the same problem.
I have one table I want to delete from, and another containing the ID:s of
the rown I want to delete. I've made a simple join (so only ID:s preset in
both tables will be included). It works fine in prewiew, but won´t delete,
returning the same error message as for Steven.

Are there any specific criteria the tables must/musn't fulfil in order for
rows to be deleted? Anything reguarding connections to other tables or types
of data in the table?

And where do I find the SQL when running a simpla query like this, which you
asked Steven to post?

Thanks!
/Johanna



"Ofer" skrev:
Can you post your SQL?

Try and change it to
DELETE DISTINCTROW Parts_Detail.*
FROM Parts_Detail INNER JOIN Query4 ON Parts_Detail.['ID'] = Query4.['ID']


--
Please respond to the group if your question been answered or not, so other
can refer to it.
Thank you and Good luck



Steven M. Britton said:
I have done as you suggested and if I switch to Datasheet view I can see the
27 records I want to delete. But when I hit the ! for run I get the same
error???

Further Ideas?

:

First make back up for your data, there will be no return

In the Query join the table and the query, instead of creating a criteria

DELETE Parts_Detail.*
FROM Parts_Detail INNER JOIN Query4 ON Parts_Detail.['ID'] = Query4.['ID']

For future reference you should try and avoid names that includes quotes

--
Please respond to the group if your question been answered or not, so other
can refer to it.
Thank you and Good luck



:

This is giving me the error: "Could not delete from specified tables."

Little help?

DELETE Parts_Detail.['ID'], Parts_Detail.*
FROM Parts_Detail, Query4
WHERE (((Parts_Detail.['ID'])=[Query4]!['ID']));
 
Johanna said:
I found the SQL, and it goes like this:

DELETE Pres.*
FROM Pres INNER JOIN Stream_ID ON Pres.[Lake-ID] = Stream_ID.[Lake-ID];

Where Pres is the table to delete from and Stream_ID is the table containing
the rows that sould be deleted from Pres.
Lake-ID is the common ID connecting the two tables.


"Johanna" skrev:
I´m having the same problem.
I have one table I want to delete from, and another containing the ID:s of
the rown I want to delete. I've made a simple join (so only ID:s preset in
both tables will be included). It works fine in prewiew, but won´t delete,
returning the same error message as for Steven.

Are there any specific criteria the tables must/musn't fulfil in order for
rows to be deleted? Anything reguarding connections to other tables or types
of data in the table?


Are you sure the records can be deleted under other
circumstances? If not, try changing the delete query to a
select query, displaying the query's datasheet and then
select a record and hit the delete key. What happened?

WARNING: Make a backup copy of the table before fooling
around with deleting data.
 
I'll try this in a different Manner. What I need is to delete about 27
records from a table that meet a critera of two other queries that come
together in Query4.

I need to be able to "filter" my Parts_Detail Table down to those 27 records
to process the Delete Query. Could I use something like Dlookup or another
type of function to get those 27 ID's as the critera.

Maybe I should right an IN Clause via VBA to make a list...???

-Steve

Marshall Barton said:
Johanna said:
I found the SQL, and it goes like this:

DELETE Pres.*
FROM Pres INNER JOIN Stream_ID ON Pres.[Lake-ID] = Stream_ID.[Lake-ID];

Where Pres is the table to delete from and Stream_ID is the table containing
the rows that sould be deleted from Pres.
Lake-ID is the common ID connecting the two tables.


"Johanna" skrev:
I´m having the same problem.
I have one table I want to delete from, and another containing the ID:s of
the rown I want to delete. I've made a simple join (so only ID:s preset in
both tables will be included). It works fine in prewiew, but won´t delete,
returning the same error message as for Steven.

Are there any specific criteria the tables must/musn't fulfil in order for
rows to be deleted? Anything reguarding connections to other tables or types
of data in the table?


Are you sure the records can be deleted under other
circumstances? If not, try changing the delete query to a
select query, displaying the query's datasheet and then
select a record and hit the delete key. What happened?

WARNING: Make a backup copy of the table before fooling
around with deleting data.
 
Sorry Steven, that's just too vague for me to be able to
provide a meaningful response.
--
Marsh
MVP [MS Access]

I'll try this in a different Manner. What I need is to delete about 27
records from a table that meet a critera of two other queries that come
together in Query4.

I need to be able to "filter" my Parts_Detail Table down to those 27 records
to process the Delete Query. Could I use something like Dlookup or another
type of function to get those 27 ID's as the critera.

Maybe I should right an IN Clause via VBA to make a list...???

Johanna said:
I found the SQL, and it goes like this:

DELETE Pres.*
FROM Pres INNER JOIN Stream_ID ON Pres.[Lake-ID] = Stream_ID.[Lake-ID];

Where Pres is the table to delete from and Stream_ID is the table containing
the rows that sould be deleted from Pres.
Lake-ID is the common ID connecting the two tables.


"Johanna" skrev:
I´m having the same problem.
I have one table I want to delete from, and another containing the ID:s of
the rown I want to delete. I've made a simple join (so only ID:s preset in
both tables will be included). It works fine in prewiew, but won´t delete,
returning the same error message as for Steven.

Are there any specific criteria the tables must/musn't fulfil in order for
rows to be deleted? Anything reguarding connections to other tables or types
of data in the table?
Marshall Barton said:
Are you sure the records can be deleted under other
circumstances? If not, try changing the delete query to a
select query, displaying the query's datasheet and then
select a record and hit the delete key. What happened?

WARNING: Make a backup copy of the table before fooling
around with deleting data.
 
Back
Top