Delete Query based on result of select query

Tech-Archive recommends: Fix windows errors by optimizing your registry

From: Ted Allen (anonymous_at_discussions.microsoft.com)
Date: 07/02/04


Date: Fri, 2 Jul 2004 09:47:26 -0700

Hi John,

My guess is that when you changed the select query to a
delete query you may not have specified which table you
want to delete the records from.

When you changed your select query to a delete query, a
new line in the query builder should have appeared
(labeled "delete:") which allows you to specify which
table you want to delete records from. In one column you
should select the table.* that you want to delete from,
and then select FROM on the delete line. For any
additional columns in the query, the setting should be
WHERE, to specify your criteria.

HTH, Ted Allen
>-----Original Message-----
>Hi there,
>
>I am going round in circles here and hope that someone
can
>give me some help.
>
>I have a select query that finds 18 records (with a
>primary key made up of four fields) - I then want to
>delete these 18 records from a table.
>
>I tried creating a delete query based on the table and
>using dlookup in the criterier of the four fields but
this
>only results in one record being deleted.
>
>I then tried creating a select query linking the
previous
>query and the table I wished to delete from by linking
on
>the four fields. As a select the query showed me all 18
>records but as soon as I changed the query type to
delete
>and run it I get "specify the table containing the
records
>you want to delete".
>
>Is it going to be possible to do what I am trying to do
>using query alone or will I need to write some sql?
>
>looking forward to any help you can offer.
>
>with kind regards
>
>John Finch
>.
>



Relevant Pages

  • Re: Report parameters
    ... I open the report, frmSpecifyRecord shows up, I ... Another field in the query is SessionDate. ... Between And as the criteria, ... Now I want to specify the date range on frmSpecifyRecord, ...
    (microsoft.public.access.reports)
  • Re: header problem - want to display html AND download a file
    ... > database and then create an excel spreadsheet and download it to their ... > various fields and criteria to specify for the search. ... > once the user clicks the button to submit the query the file ...
    (comp.lang.php)
  • Re: Hep with querying between two dates
    ... I had used it to show multiple criteria in a single field, ... I want a form that shows all information and the ability to specify ... Start and End in the Form, not the query. ... and the Removed criteria is on the second ...
    (microsoft.public.access.forms)
  • header problem - want to display html AND download a file
    ... when the user clicks on the "create a custom query" link on the ... various fields and criteria to specify for the search. ... hidden (taken from the search criteria page) but this seems cumbersome ...
    (comp.lang.php)
  • MS Access/VBA Question - Using Multiple combo Boxes to Search on a Form
    ... -I have a form with several combo boxes and several text ... a button is clicked which launches a new form (frmResults). ... frmResults is bound to a query, the criteria of which is set to the ... specify anything for a particular field. ...
    (microsoft.public.office.developer.vba)