Re: filter a table based on a query

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance



Try

DELETE DISTINCTROW ....


To delete, over a join, Jet requires the DISTINCTROW keyword (to not
short-circuit the bookkeeping, my guess).



Hoping it may help,
Vanderghast, Access MVP

"justine" <justinecandoit@xxxxxxxxx> wrote in message
news:1174442004.897404.89530@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
What I really want to do is update a table when another table has been
edited.
I have a table of attendence, and another for registration that the
table attendence is created from based on an Append Query.
I managed to create a delete query for when course are cancelled to
delete records in the attendence table, but when an individual cancels
a course, I'm having trouble figuring out how to delete because this
query and table are not linked directly.
So I was thinking alternatively of writing a macro and applying a
query to filter my table and then working out that all 'present'
fields should be unmarked, or having the user do it, but I can't get
it to work...

My attempt at delete query is:

DELETE tblCourse_Attendence2.*, tblRegistration.Cancellation
FROM tblRegistration INNER JOIN tblCourse_Attendence2 ON
(tblRegistration.FullName = tblCourse_Attendence2.Full_Name) AND
(tblRegistration.CourseYr = tblCourse_Attendence2.CourseID)
WHERE (((tblRegistration.Cancellation)=True));

and error message is:

"could not delete from specified tables"

Thanks!
-justine



.



Relevant Pages

  • filter a table based on a query
    ... I have a table of attendence, and another for registration that the ... I managed to create a delete query for when course are cancelled to ... delete records in the attendence table, but when an individual cancels ... query to filter my table and then working out that all 'present' ...
    (microsoft.public.access.queries)
  • Re: filter a table based on a query
    ... I've been warned not to use them, although I have cascade update set ... I have a table of attendence, and another for registration that the ... table attendence is created from based on an Append Query. ... delete records in the attendence table, but when an individual cancels ...
    (microsoft.public.access.queries)
  • Re: filter a table based on a query
    ... I admit this is not always ... I have a table of attendence, and another for registration that the ... table attendence is created from based on an Append Query. ... delete records in the attendence table, but when an individual cancels ...
    (microsoft.public.access.queries)
  • Re: Read Only Query
    ... I'll give you a brief explanation why the query is read- ... However, in a non-totals query, ... possibility of corrupting data. ... >> Does the query remain read-only when you add the DISTINCTROW keyword? ...
    (microsoft.public.access.queries)
  • RE: crosstab query failed emergency help
    ... Then use this query as a crosstab where the CalendarDate field is converted ... the Employee and the Month of CalendarDate. ... Microsoft Access MVP ... fields as month/year, date, attendence. ...
    (microsoft.public.access.queries)