delete query question

O

Opal

I have a database for tracking equipment repair requests.

Each shift, if they have a problem with a piece of equipment, will
enter a "concern" into the database. If both shifts have the same
problem then a request for "countermeasure" is created.

I have created a select query which brings the two shifts' concerns
together if they are the same. This query comes up on a form
to show the users what concerns need to be submitted for
countermeasure request. The form writes the concerns to another
table. Once these concerns are written to this new table, I want to
delete them from the "original" tables. I wanted to make it very
easy to perform the task and placed a button on the countermeasure
request form to delete the records (delete query), unfortunately,
since
the tables I am deleting data from are "programmatically" connected
to the form via the select query, I cannot delete the records.

Can anyone suggest a work around for this problem?
 
O

Opal

I have a database for tracking equipment repair requests.

Each shift, if they have a problem with a piece of equipment, will
enter a "concern" into the database. If both shifts have the same
problem then a request for "countermeasure" is created.

I have created a select query which brings the two shifts' concerns
together if they are the same. This query comes up on a form
to show the users what concerns need to be submitted for
countermeasure request. The form writes the concerns to another
table. Once these concerns are written to this new table, I want to
delete them from the "original" tables. I wanted to make it very
easy to perform the task and placed a button on the countermeasure
request form to delete the records (delete query), unfortunately,
since
the tables I am deleting data from are "programmatically" connected
to the form via the select query, I cannot delete the records.

Can anyone suggest a work around for this problem?

What about subquery? Does anyone have any experience with these?
I am reading about them on Allen Browne's website.
 
6

'69 Camaro

Hi, Opal.
I wanted to make it very
easy to perform the task and placed a button on the countermeasure
request form to delete the records (delete query), unfortunately,
since
the tables I am deleting data from are "programmatically" connected
to the form via the select query, I cannot delete the records.

If you save the query as a QueryDef object (those are listed in the Queries
tab of the Database Window), then you can use this query as the RecordSource
Property of the form. As soon as the rows are deleted with your code,
requery the form. The deleted rows will disappear from the form.

HTH.
Gunny

See http://www.QBuilt.com for all your database needs.
See http://www.Access.QBuilt.com for Microsoft Access tips and tutorials.
Blogs: www.DataDevilDog.BlogSpot.com, www.DatabaseTips.BlogSpot.com
http://www.Access.QBuilt.com/html/expert_contributors2.html for contact
info.
 
O

Opal

I have a database for tracking equipment repair requests.

Each shift, if they have a problem with a piece of equipment, will
enter a "concern" into the database. If both shifts have the same
problem then a request for "countermeasure" is created.

I have created a select query which brings the two shifts' concerns
together if they are the same. This query comes up on a form
to show the users what concerns need to be submitted for
countermeasure request. The form writes the concerns to another
table. Once these concerns are written to this new table, I want to
delete them from the "original" tables. I wanted to make it very
easy to perform the task and placed a button on the countermeasure
request form to delete the records (delete query), unfortunately,
since
the tables I am deleting data from are "programmatically" connected
to the form via the select query, I cannot delete the records.

Can anyone suggest a work around for this problem?

Nevermind....got the subquery worked out and it does what I wanted it
to do!
 
Top