All of the top level objects can be initialized with the CustomWhereClause. This initialize parameter allows you to pass in a string that evaluates one of the fields directly off of the top level object. Here is an example that limits the CRecords collection to those constituent that have the last name of Smith.

Public Sub FindTheSmiths()

Dim oRec As CRecord

Dim sTemp As String

sTemp = "last_name = 'Smith'"

Dim oRecords As CRecords

Set oRecords = New CRecords

oRecords.Init REApplication.SessionContext, tvf_record_CustomWhereClause, sTemp

'To Loop through results

If oRecords.Count > 0 Then

For Each oRec In oRecords

'You could add them to a front-end query here


Next oRec

End If

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