Public Sub ReadEvent()



Dim oEvent As CSpecialEvent

Set oEvent = New CSpecialEvent

oEvent.Init REApplication.SessionContext



Dim oAttribute As IBBAttribute



'load a specific event from the sample database

oEvent.Load 8



Dim reService As REServices

Set reService = New REServices

reService.Init REApplication.SessionContext



'loop through the event's attributes

For Each oAttribute In oEvent.Attributes

   Dim oAttributeTypeServer As CAttributeTypeServer

   Set oAttributeTypeServer = reService.CreateServiceObject(bbsoAttributeTypeServer)

   oAttributeTypeServer.Init REApplication.SessionContext

   

   Dim lID As Long

   lID = oAttribute.Fields(Attribute_fld_ATTRIBUTETYPES_ID)

   'oAttribute.Fields (Attribute_fld_ATTRIBUTES_ID)

   

   Debug.Print oAttributeTypeServer.GetAttributeTypeDescription(lID)

   Debug.Print oAttribute.Fields(Attribute_fld_VALUE)

   Debug.Print oAttribute.Fields(Attribute_fld_COMMENTS)

   Debug.Print oAttribute.Fields(Attribute_fld_ATTRIBUTEDATE)





   Set oAttributeTypeServer = Nothing

Next oAttribute



'clean up

reService.CloseDown

Set reService = Nothing



Set oAttribute = Nothing



oEvent.CloseDown

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