DELETE Query wants o know about which table to delete from - JOINE

DELETE Query wants o know about which table to delete from - JOINE

Post by Qmx1ZVdvbH » Thu, 12 Feb 2009 02:57:02


Hello,
MS ACCESS 2003 on XP PRO.

My delete query, which is meant to join two tables, and delete from Table A
all the records in it, not in Table B.

Below is the Code for the query. The problem is that the select aspect
works perfect but when I try to run the delete, it asks me to specify a table.

DELETE t2.Program, t2.ModelYear, t2.BuildPhase, t2.Month, t2.TagType,
t2.Projection, t2.Actual, t2.MonthName, t2.MonthDate, t2.CalendarYear,
t1.ModelYear, t1.ProgramName, t1.BuildPhase, t1.TagType, t1.Month,
t1.YearChoice


FROM t_TempCounts as t1 RIGHT JOIN t_VehicleCounts as t2 ON (t1.YearChoice =
t2.CalendarYear) AND (t1.TagType = t2.TagType) AND (t1.Month = t2.Month) AND
(t1.BuildPhase = t2.BuildPhase) AND (t1.ModelYear = t2.ModelYear) AND
(t1.ProgramName = t2.Program)


WHERE (((t2.CalendarYear)=[Forms]![frm_MAINMENU]![YearPick]) AND
((t1.ModelYear) Is Null) AND ((t1.ProgramName) Is Null) AND ((t1.BuildPhase)
Is Null) AND ((t1.TagType) Is Null) AND ((t1.Month) Is Null) AND
((t1.YearChoice) Is Null));
<<<<

Help!

Thank you

--
BlueWolverine
MSE - Mech. Eng.
Go BLUE!
 
 
 

1. Delete query (joined to 2 tables) won't delete Please help--dim bu

2. Delete Query Error "Can't delete from specified tables

My Delete query uses only one table to delete from based on the query
result from another query using a different table. Ihave tried with the
unique records Yes and No.

My first query, get distinct values from an Item list, looks like this
and works great:
SELECT DISTINCT [JobLineItems].[ModelNum]
FROM JobLineItems;

Using that I identify the records in the products list that I want to
delete. This works also.
SELECT ProductsList.MFGName, ProductsList.ModelNum,
ProductsList.Description, ProductsList.ItemCost,
ProductsList.ItemRetail, ProductsList.DEPrice
FROM ProductsList, [A ModelNumQuery]
WHERE (((ProductsList.ModelNum)=[A ModelNumQuery].[ModelNum]));

But, then I turn this query into a delete query. I get the error
message Cant not delete from specified tables.
DELETE ProductsList.*, ProductsList.ModelNum
FROM ProductsList
WHERE (((ProductsList.ModelNum)=[A ModelNumQuery].[ModelNum]));

If I put a model number in the query it works. Ex, WHERE
(((ProductsList.ModelNum)=[ ="AMP-100"

The Products list has ModelNum as its primary key and is not related to
any other tables. IT IS USED FOR LOOKUP.
I have tried it with DISTINCTROW and without. No good.

Any help would be appreciated.

3. Delete Query cannot delete specified from specified tables...

4. Delete Query v Could not Delete from Specified tables

5. Delete Query - Delete records in Table 1 using parameters from Tab

6. Delete Query Could not delete from specified tables

7. Delete query (joined 3 tables) could not delete from specified tab

8. Delete query (joined to 2 tables) won't delete Please help--di

9. Delete query error "Could not delete from specified tables"

10. Delete Query Error "Can't delete from specified tables

11. Delete query - delete from specified tables error

12. delete query - could not delete from specified table

13. Importing, delete query or delete table

14. deleted files, deleted FROM deleted file folder REAPPEARING in deleted folder..

15. Can I delete a Word table without also deleting table's content?