Simple Delete? Not For Me

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

Guest

I need to delete records from several tables but I get an error about
selecting the table where to delete these records?

This is an example of one of the tables I need to delete these records from.
I first did a select query (OrderID's To Delete)
I then tried creating my delete query using that query

DELETE dbo_tblOrderExtraCharges.OrderID
FROM [OrderID's To Delete] INNER JOIN dbo_tblOrderExtraCharges ON [OrderID's
To Delete].OrderID = dbo_tblOrderExtraCharges.OrderID;

Any help would be appreciated.
 
I need to delete records from several tables but I get an error about
selecting the table where to delete these records?

This is an example of one of the tables I need to delete these records
from.
I first did a select query (OrderID's To Delete)
I then tried creating my delete query using that query

DELETE dbo_tblOrderExtraCharges.OrderID
FROM [OrderID's To Delete] INNER JOIN dbo_tblOrderExtraCharges ON
[OrderID's
To Delete].OrderID = dbo_tblOrderExtraCharges.OrderID;

Please read
http://support.microsoft.com/default.aspx?scid=kb;en-us;207761

***quote****

Delete Queries

When a delete query contains more than one table,
such as a query that deletes duplicate records from one of the tables,
the UniqueRecords property must be set to Yes for all versions of Microsoft
Access.

However, because the default value for UniqueRecords is No in Access 2000,
you must set the value of this property manually when you create a new
delete query in Access 2000.

To do so, follow these steps:
Open the delete query in Design view.
If the property sheet is not already open, on the View menu, click
Properties.
Click an empty area in the upper half of the query window so that the
property sheet displays "Query Properties" in the title bar.
Set the UniqueRecords property to Yes.
Save the query, close it, and then run the query.
***unquote***

good luck,

gary
 
Try the following:

DELETE DistinctRow dbo_tblOrderExtraCharges.OrderID
FROM [OrderID's To Delete] INNER JOIN dbo_tblOrderExtraCharges
ON [OrderID's To Delete].OrderID = dbo_tblOrderExtraCharges.OrderID

If that fails then try

DELETE DistinctRow dbo_tblOrderExtraCharges.OrderID
FROM dbo_tblOrderExtraCharges
WHERE dbo_tblOrderExtraCharges.OrderID in
(SELECT OrderID's To Delete].OrderID
FROM [OrderID's To Delete])

If that fails, then I suspect that you might want to post the table structure of
the tables you are using and the actual error message you are getting.
 
Back
Top