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 gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Search and Delete Record from Multiple Tables 1

Status
Not open for further replies.

DTSjunkie

MIS
Jul 4, 2006
9
US
I want to create a single delete button for my Access Form. I have three tables: Contacts, Questionnaire, and Tracking. When the user clicks the delete button I would like to permanently delete the entire record (knowing the subject ID that connects all three) from each of the three tables.
 
Have you considered Cascade Delete? Alternatively, build SQL statements in code and run them:
[tt]strSQL = "Delete * From tblTable Where ID=" & intID
DoCmd.Run strSQL[/tt]
 
Worked perfectly...One more thing

I use a VBA MSG box to confirm the delete at the beginning. Is there anyway to prevent access from asking the user to confirm the delete of the record from each table?
 
Thank you very much........both suggestions worked perfectly!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top