Kamis, 14 Juli 2011

Re: [MS_AccessPros] Delete query giving me error

 

Hi Jim,

when I have trouble with delete queries, I turn them into SELECT queries, select all the records (Ctrl-A), and press DELETE.

Works for a one-time solution. For code, you sometimes have to nest queries or loop through a recordset.

for what its worth, I took a quick look at your logic. Never use * without qualifying it. And you don't need to specify the ID field. Try this:

DELETE tblEventDetails.*
FROM tblEventDetails
WHERE tblEventDetails.EventID IN
(SELECT EventID FROM tblArchivedEventIDs)

Warm Regards,
Crystal

*
(: have an awesome day :)
*

--- On Thu, 7/14/11, luvmymelody wrote:

> Hello All,
>
> I am getting the following error "Specifiy the table
> containing the records you want to delete".
>
> The following sql statement is based on the post number
> 68733. But I continue to get the error.
>
> DELETE tblEventDetails.EventID, *
> FROM tblEventDetails INNER JOIN tblArchivedEventIDs ON
> tblEventDetails.EventID = tblArchivedEventIDs.EventID
> WHERE
> (((tblEventDetails.EventID)=[tblArchivedEventIDs].[EventID]));
>
> I am trying to delete a set of records in a table based on
> values in a second table. I am surely missing something.
> Does anyone see the problems?
>
> Thank you for your help very much
>
> Jim Wagner
>
>

__._,_.___
Recent Activity:
.

__,_._,___

Tidak ada komentar:

Posting Komentar