Public Sub GLDistribs()

Dim oConstit As CRecord

Set oConstit = New CRecord

oConstit.Init REApplication.SessionContext

Dim oGift As CGift

Set oGift = New CGift

oGift.Init REApplication.SessionContext

Dim oGLD As CGiftGLDistribution

oConstit.Load 678    'Loading 1 record to test

For Each oGift In oConstit.Gifts

   If oGift.Fields(GIFT_fld_Fund) = "Gregg's Fund" Then   'Loops gift collection for 1 Fund to test

       For Each oGLD In oGift.GLDistributions

           Debug.Print oGift.Fields(GIFT_fld_Type) & " " & _

           oGift.Fields(GIFT_fld_Date) & " " & _

           oGift.Fields(GIFT_fld_Amount) & " " & _

           oGLD.Fields(GIFTGLDISTRIBUTION_fld_DebitAccountDesc) & " " & _

           oGLD.Fields(GIFTGLDISTRIBUTION_fld_DebitNumber) & " " & _

           oGLD.Fields(GIFTGLDISTRIBUTION_fld_CreditAccountDesc) & " " & _


       Next oGLD

   End If

Next oGift

Set oGLD = Nothing

Set oGift = Nothing


Set oConstit = 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. Our Customer Support can help explain the functionality of a particular procedure, but we will not modify, or assist you with modifying, these examples to provide additional functionality. If you are interested in learning more about the VBA and API modules, contact your account manager.