Public Sub FundRel()
    Dim oFundRel As CFundRelationship
    Set oFundRel = New CFundRelationship
    oFundRel.Init REApplication.SessionContext
   
    Dim oFund As CFund
    Set oFund = New CFund
    oFund.Init REApplication.SessionContext
    oFund.LoadByField fufFUND_ID, "SBSF"
   
    ''the Fund field should be populated with the
    ''Fund ID or Fund Description depending on user option
    ''see BB700886 for determining which should be used
    oFundRel.Fields(FUNDRELATION_fld_FUND) = oFund.Fields(Fund_fld_DESCRIPTION)
   
    ''system record ID of the constituent
    oFundRel.Fields(FUNDRELATION_fld_CONSTIT_ID) = 280
   
    oFundRel.Fields(FUNDRELATION_fld_DATE_FROM) = "01/01/2000"
    oFundRel.Fields(FUNDRELATION_fld_RELATION_CODE) = "Scholarship Fund"
    oFundRel.Fields(FUNDRELATION_fld_RECIP_RELATION_CODE) = "Benefactor"
   
    oFundRel.Save
   
    oFund.CloseDown
    Set oFund = Nothing
   
    oFundRel.CloseDown
    Set oFundRel = 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.