HELP w/Coding Delete Parent/Child Records

J

JohnLute

I've designed what I call a "mini" BOM. I use
sfrmPKProfilesAssociations.cbProfilesAssociations to create Parent/Child
records.

This design is coded so that it also creates a "reverse" record or a
Child/Parent record. Here's
how:

Private Sub cbProfilesAssociations_Change()
Dim v_parent_id As String
Dim v_child_id As String
Dim v_Str_SQL As String

v_parent_id =
Forms!frmPKProfilesTEMPLATE.Form!sfrmPKProfilesAssociations!cbProfilesAssociations
v_child_id = Forms!frmPKProfilesTEMPLATE!txtProfileID

DoCmd.SetWarnings False
v_Str_SQL = "Insert Into tblPKProfilesAssociations Values ('"
v_Str_SQL = v_Str_SQL & v_child_id & "','" & v_parent_id & "')"
DoCmd.RunSQL (v_Str_SQL)
DoCmd.SetWarnings True

End Sub

My objective now is is to select a record in sfrmPKProfilesAssociations and
delete it AND it's "reversed" record. However, I'm a novice when it comes to
coding.

This is a real challenge - any help would be greatly appreciated!

Thanks!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top