Public Sub MembershipAttributes()



Dim oMember As CMembership

Set oMember = New CMembership

oMember.Init REApplication.SessionContext



Dim oAttribute As IBBAttribute



'load a specific Membership record from the sample database

oMember.Load 88



Dim reService As REServices

Set reService = New REServices

reService.Init REApplication.SessionContext



'loop through the Membership's attributes

For Each oAttribute In oMember.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)

  

  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



oMember.CloseDown

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