Private Sub ConstitSubSelect()

    Dim oRecs As CRecords
    Set oRecs = New CRecords

    Dim sCWC As String
    sCWC = "RECORDS.ID IN (SELECT R.ID FROM RECORDS R INNER JOIN GIFT G ON G.CONSTIT_ID = R.ID WHERE G.AMOUNT > 5000)"

    oRecs.Init REApplication.SessionContext, tvf_record_CustomWhereClause, sCWC

    Debug.Print oRecs.Count

    oRecs.Closedown
    Set oRecs = Nothing

End Sub