i want to execute a delete-query based on the value of a textfield. is there a way to fill that WHERE-Clause in the SQL-statement with the value of a textfield from my form? The Name of the textfield is SID
Private Sub delSYS_Click()
DoCmd.OpenQuery "qry-delSystem"
End Sub
SQL-Statement from the query:
DELETE [tbl-planung].SID, [tbl-apartner].*
FROM [tbl-planung] INNER JOIN [tbl-apartner] ON [tbl-planung].SID = [tbl-apartner].SID
WHERE ((([tbl-planung].SID)=Me!SID));
When i execute that query, it always asks me for the value of Me!SID. My goal is to delete the System from the table "tbl-planung" including the matching record in the contacts table "tbl-apartner" where the Value of "SID" is identical.