delete query question

  • Thread starter Thread starter Opal
  • Start date Start date
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?
 
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.
 
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.
 
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!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

Delete Query: Could not delete from specified tables 0
One to many help 4
"...A Related record is required...." 6
Delete query help 2
Query Help 5
DELETE QRY issue 4
DMax function 5
Using Option group to sort 4

Back
Top