Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / Queries / April 2006

Tip: Looking for answers? Try searching our database.

Simple Delete? Not For Me

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
cvegas - 30 Apr 2006 13:28 GMT
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.
Gary Walter - 30 Apr 2006 15:41 GMT
>I need to delete records from several tables but I get an error about
> selecting the table where to delete these records?
[quoted text clipped - 8 lines]
> [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
John Spencer - 30 Apr 2006 15:48 GMT
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.

> I need to delete records from several tables but I get an error about
> selecting the table where to delete these records?
[quoted text clipped - 8 lines]
>
> Any help would be appreciated.
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.