Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Access 97 - Deleting Records via Button

Status
Not open for further replies.

Russ2204

IS-IT--Management
Feb 13, 2002
35
GB
Urgent help needed please.

I have a form which has a button on which when clicked I would like it to delete the record and all records linked to it.

e.g. We have a field called file ref. When you enter the name in it brings up all the records under that file ref. The form is also linked to other tables which have records relating to the file ref. When the button is clicked I would like it to delete all records under that file ref. including any records under that file ref in other tables.

How do I do this?
 
Check the relationship between the tables, and make sure cascade delete is selected - this will take care of your problem (I hope! :p) Another solution is to create a Delete query which you can use in a VBA Code module to remove all references to said file ref #. If you need a bit of guidance writing the statement, search out myself at the e-mail address below, or look for a gentleman in this forum by the name of tlbroadbent...he knows his SQL.

HTH

Greg Tammi, ATS Alarm Supervisor
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top