Private Sub GiftbyDateRange()

    Dim oGifts As CGifts
    Set oGifts = New CGifts
   
    oGifts.Init REApplication.SessionContext, tvf_Gift_UseFilterObject
    oGifts.FilterObject.DateRange = bbDATE_SPECIFICRANGE

    oGifts.FilterObject.StartDate = "01/01/2008"
    oGifts.FilterObject.EndDate = "12/31/2009"

    Dim oGift As CGift

 

        For Each oGift In oGifts
            Debug.Print oGift.Fields(GIFT_fld_Date)
            If Right(oGift.Fields(GIFT_fld_Date), 4) < 2008 Then
                MsgBox "Gift out of range: " & oGift.Fields(GIFT_fld_ID)
                GoTo EH:
            Else: End If
        Next oGift

    Set oGift = Nothing
    oGifts.Closedown
    Set oGifts = Nothing

 

    Exit Sub

EH:
    Set oGift = Nothing
    oGifts.Closedown
    Set oGifts = Nothing

 

End Sub