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

Delete Record AND The Subform it contains

Status
Not open for further replies.

dominicdunmow

Technical User
Jul 28, 2004
125
CA
Hi,

I have a 'Delete' command button on a form which I want to use to transfer a record to another table and then delete it from the original table.

The From contains a subform though, so I can delete the data
from the record that is stored in the parent form using DoCmd.RunSQL "INSERT INTO... then deleting the record.

But I can't work out how to delete the subform record. The link between the form and subform is the field "OPP ID" but I gather I can't use an DoCmd.RunSQL "INSERT INTO with a WHERE clause.

My logic would have been to delete the subform record where Opp ID = Opp ID in the main form but it doesn't seem to work (missing semicolon error message)

Can anyone help please?

 
I've sussed it, it works with an Insert Select statement.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top