Allen:
I copied your code, and it inserted a new column Expr1, with the value
"/xxx" in every row. (not what I wanted, I think). In addition, I still
got the original error message: "Could not delete from specified tables."
So then I used your next suggestion using the * to get the following SQL
DELETE tblFlightNumberQuery.*, tblFlightNumberQuery.FltNum
FROM tblFlightNumberQuery
WHERE ((Right([FltNum],4)="/xxx"));
In design view, this looks like what I want, but I get the same error on
this also: "Could not delete from specified tables."
Any more suggestions?
Bernie
Allen Browne said:
Drop the field list from the DELETE clause, i.e.:
DELETE FROM tblFlightNumberQuery WHERE Right([FltNum],4) = "/xxx";
In the query design interface, you could probably achieve that by
dragging the * from the table into the grid. Access then puts "From" in
the delete row under that field.
--
Allen Browne - Microsoft MVP. Perth, Western Australia.
Reply to group, rather than allenbrowne at mvps dot org.
bw said:
Thanks for the reply, Allen!
Here is the SQL code you asked for:
DELETE tblFlightNumberQuery.FltNum, Right([FltNum],4) AS Expr1
FROM tblFlightNumberQuery
WHERE (((Right([FltNum],4))="/xxx"));
This code selects the correct records to be deleted when I run it in
design mode.
Bernie
If the query contains only ONE table, it should delete okay.
If it contains multiple tables, there may be an issue with which one
you are deleting from.
If you can't sort it out, switch the query to SQL View (View menu, in
query design), and paste the SQL statement as a reply to this thread.
I'm receiving a message when trying to run a Delete Query: "Could not
delete from specified tables."
I can't determine what is causing the problem. The help message
indicates that it is a security problem, but I don't see how. Can
someone give me some things to look for that may be causing this
problem?