Option Explicit

Public Sub EventPart()



Dim oParticipant As CParticipant

Set oParticipant = New CParticipant

oParticipant.Init REApplication.SessionContext

'Load the participant's record

oParticipant.Load 44





With oParticipant

   Dim lEventID As Long

   Dim lPriceID As Long

   'Get the Event ID to later get the Price Information

   lEventID = .Fields(Participants_fld_EventID)

   'Load the Event

   Dim oEvent As CSpecialEvent

   Set oEvent = New CSpecialEvent

   oEvent.Init REApplication.SessionContext

   

   oEvent.Load lEventID

   

   Dim oprice As CEventPrice

   'Get the Event Price ID for the Unit needed

   For Each oprice In oEvent.Prices

       If oprice.Fields(EventPrices_fld_Unit) = "Group" Then

           lPriceID = oprice.Fields(EventPrices_fld_ID)

       End If

   Next oprice

   'Closedown Event

   oEvent.CloseDown

   Set oEvent = Nothing

   Set oprice = Nothing

   

   Dim oFee As CParticipantFee

   For Each oFee In .Fees

       If oFee.Fields(ParticipantFees_fld_Unit) = "Individual" Then

       'Assign the Event Prices ID that is accociated with the unit you want _

       to change the unit to.

      oFee.Fields(ParticipantFees_fld_EventPricesID) = lPriceID

    

       End If

   Next oFee

   

   Set oFee = Nothing

 End With





'Save the participant

oParticipant.Save



'clean up

oParticipant.CloseDown

Set oParticipant = 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 Structured Query Language and the tools used to create and modify SQL statements and Crystal Reports. Our Customer Support may help explain the functionality of a particular procedure, but we will not modify, or assist you with modifying, these examples to provide additional functionality.