Private Sub TestCMProj()

    Dim oFECredit As CAPCreditMemo
    Set oFECredit = New CAPCreditMemo
       
        With oFECredit
          .Init FE_Application.SessionContext
   
          .Fields(EAPCreditMemosFields.APCREDITMEMOS_fld_AP7VENDORSID) = 31
   
          .Fields(EAPCreditMemosFields.APCREDITMEMOS_fld_AMOUNT) = 100
          .Fields(EAPCreditMemosFields.APCREDITMEMOS_fld_CREDITMEMODATE) = "9/17/09"
          .Fields(EAPCreditMemosFields.APCREDITMEMOS_fld_POSTDATE) = "9/17/09"
          .Fields(EAPCreditMemosFields.APCREDITMEMOS_fld_CREDITMEMONUMBER) = "Sept 09"
          .Fields(EAPCreditMemosFields.APCREDITMEMOS_fld_DESCRIPTION) = "Advance Pay Back"
   
          With .Distribution.Add
             .Fields(EBBDistributionsFields.BBDISTRIBUTIONS_fld_CREDITACCTNUM) = "01-2000-00"
             .Fields(EBBDistributionsFields.BBDISTRIBUTIONS_fld_AMOUNT) = 100
             .Fields(EBBDistributionsFields.BBDISTRIBUTIONS_fld_DEBITACCTNUM) = "01-1000-00"
             .Fields(EBBDistributionsFields.BBDISTRIBUTIONS_fld_AMOUNT) = 100
   
          End With
   
   
          .Save
   
          With .Distribution.Item(1).TransactionDistributions(bbTranDistType_Credit).Item(1)
            .Fields(BBTRANSACTIONDISTRIBUTIONS_fld_GL7PROJECTSID) = 9999
            .Save
          End With
         
          With .Distribution.Item(1).TransactionDistributions(bbTranDistType_Debit).Item(1)
            .Fields(BBTRANSACTIONDISTRIBUTIONS_fld_GL7PROJECTSID) = 9999
            .Save
          End With
         
          .Save
         
      End With

    oFECredit.CloseDown
    Set oFECredit = Nothing
   
End Sub