Public Sub SearchforFund()

   Dim oFunds As CFunds

   Dim oFund As CFund

   Dim sFundIDSQL As String

   Dim sFundDateSQL As String

   Dim sFundCategorySQL As String


   'SQL Statements will allow you to search by certain fields for a fund

   'three different statements based on request in case

   sFundIDSQL = "FUND_ID like '%Annual'"

   sFundDateSQL = "(START_DATE > '2007-01-01') and (END_DATE < '2009-01-01')"

   sFundCategorySQL = "FUND.ID IN (SELECT FUND.ID " & _





   Set oFunds = New CFunds


   'Change out the SQL string to get the different results

   oFunds.Init REApplication.SessionContext, tvf_Fund_Custom, True, sFundCategorySQL


   MsgBox oFunds.Count

   'looping through all the funds to get information

   For Each oFund In oFunds

       Debug.Print oFund.Fields(Fund_fld_DESCRIPTION) & " - " & oFund.Fields(fund_fld_FUND_ID)


   Next oFund


   Set oFund = Nothing



   Set oFunds = 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.