Create a records delete button on a form.

mrbebop

Registered User.
Local time
Today, 04:08
Joined
Jun 6, 2003
Messages
32
I have a form with several fields that give information to people in production as to what is needed from them to fill orders. Upon completion of these orders, there is a check box in each record that they can check when the particular order has been filled. I would like to create a button on the form that would delete all records that have been completed. I know a little about Access 2000, but not enough to handle this. Could someone please help me? Thanks very much. You people amaze me!
Robert:)
 
You will need to do a couple of things

1. create a delete query with the criteria set in the criteria box of the field you want to filter on to true

2. In the click event of the delete button, you will need to select [event procedure] and then press... and in the resulting place, type
Code:
docmd.openquery "NameofDeleteQuery"

If you are stuck on either of these, use the Access help to guide you in creating a query, using a delete query, query parameters.
 
As an alternative to Fizzio's solution you might want to consider not actually deleting the record once the order has been filled, but simply not showing the records of completed orders on the form. This would allow you to retrieve the record using a different form if, for instance, there's a question about whether the order was filled correctly or not. In your current form's query you would simply not show any records where the "order completion" box was checked.

The Missinglinq
 
Thanks

Thanks Fizzio for the excellent answer to my question and thank you missinglinq for the good suggestion. :)
 

Users who are viewing this thread

Back
Top Bottom