Public Sub SearchScreen()
   Dim ReService As REServices
   Set ReService = New REServices
   ReService.Init REApplication.SessionContext

   Dim oSearchScreen As IBBSearchScreen
   Set oSearchScreen = ReService.CreateServiceObject(bbsoSearchScreen)
   oSearchScreen.Init REApplication.SessionContext  

   Dim oConstitForm As CConstituentForm
   Set oConstitForm = New CConstituentForm
   oConstitForm.Init REApplication.SessionContext

   Dim oConstit As CRecord  

   oSearchScreen.AddSearchType (SEARCH_CONSTITUENT)
   oSearchScreen.AllowAddNew = True
   If oSearchScreen.SelectedOption = SRCH_FRM_OPEN Then
       Set oConstit = oSearchScreen.SelectedDataObject
   ElseIf oSearchScreen.SelectedOption = SRCH_FRM_CANCELLED Then
       Exit Sub
       Set oConstit = New CRecord
       oConstit.Init REApplication.SessionContext
   End If

   Set oConstitForm.ConstituentObject = oConstit
   'oconstit.Fields(RECORDS_fld_LAST_NAME)= osearchscreen.
   oConstitForm.ShowForm True
   Set oConstitForm = Nothing

   Set oConstit = Nothing 

   Set oSearchScreen = Nothing
   Set ReService = Nothing

End Sub
Note: To pre-populate certain search fields, you can use the CustomProperty. For example:

    Dim oSearch As IBBSearchScreen
    Set oSearch = oServ.CreateServiceObject(bbsoSearchScreen)
    With oSearch
        .Init REApplication.SessionContext
        .AddSearchType SEARCH_CONSTITUENT
        .CustomProperty("KEY_NAME") = "Smith"
        .CustomProperty("FIRST_NAME") = "John"

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.