Public Sub DeleteSolicitor()

Dim oConstituent As CRecord
Set oConstituent = New CRecord
oConstituent.Init REApplication.SessionContext

'load specific constituent
oConstituent.Load 280

Dim oSolicitor As CAssignedSolicitor

'loop through the constituent's assigned solicitors
For Each oSolicitor In oConstituent.Relations.AssignedSolicitors

   If oSolicitor.Fields(ASSIGNEDSOLICITOR_fld_SOLICITOR_NAME) = "Mohammed Rahman" Then
       oConstituent.Relations.AssignedSolicitors.Remove oSolicitor
       'Save parent object to save the child collection
   End If
Next oSolicitor

'clean up
Set oSolicitor = Nothing

Set oConstituent = Nothing

End Sub

Disclaimer: We provide programming examples for illustration only, without warranty either expressed or implied, including, but not limited to, the implied warranties of merchantability and/or fitness for a particular purpose. This article assumes you are familiar with Microsoft Visual Basic and the tools used to create and debug procedures. Blackbaud Customer Support may help explain the functionality of a particular procedure, but we will not modify, or assist you with modifying, these examples to provide additional functionality.