DELETE statement

JonyBravo

Registered User.
Local time
Today, 21:01
Joined
Jan 17, 2006
Messages
89
Hy again!
Can someone please tell me why the following code doesn't work?

DELETE tblHolliday.RACF AS EXP1, tblHolliday.Date
FROM tblHolliday INNER JOIN tblPlanner ON (tblHolliday.RACF = tblPlanner.RACF) AND (tblHolliday.Date = tblPlanner.Date)
WHERE (((tblHolliday.Date) Like [forms]![frmtest].[txtday1]))
WITH OWNERACCESS OPTION;


When I run it, it comes with the following error:

Specify the table containing the records you want to delete

Thanks
 
you can't use a delete query to delete just specific fields, which seems to be what you are trying to do. I would suggest

"DELETE FROM tblHolliday WHERE ((tblHolliday.Date) Like '[forms]![frmtest].[txtday1]')"
 
If you want to delete the contents of the field, use an update query.
 
Thanks to help me!
I do understand what you saying but my problem is, I need to use two different tables and I want to delete on tableA if tableB says to.
I want something like the following code but to delete the result instead return.

SELECT tblPlanner.Date, tblHolliday.RACF
FROM tblHolliday INNER JOIN tblPlanner ON (tblHolliday.RACF = tblPlanner.RACF) AND (tblHolliday.Date = tblPlanner.Date)
WHERE (((tblHolliday.Date) Like [txtday1]) AND ((tblPlanner.Date) Like [txtday1]))
WITH OWNERACCESS OPTION;

Thanks
 

Users who are viewing this thread

Back
Top Bottom