Delete*FROM question

mohobrien

Registered User.
Local time
Today, 06:28
Joined
Dec 28, 2003
Messages
58
I have a form with a subform. The main form has a bunch of data in one table and the subform has more specific info. The tables are joined in a one to many relationship.
When I delete a record in the main table from the form, I want the related records in the other table also deleted.
I tried this:
Code:
' This is to delete the holder table entries for records that are deleted. 
 Private Sub Form_AfterDelConfirm(Status As Integer)
Dim StrSQL As String
Dim DispNumToDelete As String
DispNumToDelete = Me![Disposition Number]
StrSQL = "Delete*FROM tblHolders where tblHolders.DispositionNumber=DispNumToDelete"
DoCmd.SetWarnings False
DoCmd.RunSQL StrSQL
DoCmd.SetWarnings True
End Sub
I checked DispNumToDelete and it holds the correct value as a string but I am always prompted to "Enter Parameter Value".
What am i missing?
PS Even a pointer to a help file will be useful to me as I have no skill level.
 
Set the CascadeDelete related records to yes in the relationships window
 
Many thanks!
 

Users who are viewing this thread

Back
Top Bottom