Public Sub ActivateTableEntry()



   Dim oTables As CCodeTables

   Set oTables = New CCodeTables

   oTables.Init REApplication.SessionContext

  

   Dim oTable As CCodeTable

   Dim lID As Long

   'Loop through the tables to find the one you need

   For Each oTable In oTables

       If oTable.Fields(ctfNAME) = "Teams" Then

       'Get the ID

       lID = oTable.Fields(ctfCODETABLEID)

       Exit For

       End If

       

       oTable.CloseDown

   Next oTable

  

   oTables.CloseDown

   Set oTables = Nothing

  

   Set oTable = Nothing

  

   Dim oTEs As CTableEntries

   Set oTEs = New CTableEntries

   oTEs.Init REApplication.SessionContext, lID

  

   Dim oTE As CTableEntry

      

   For Each oTE In oTEs

       If oTE.Fields(tableentry_fld_LONGDESCRIPTION) = "4" Then

           oTE.Fields(tableentry_fld_ACTIVE) = True

           oTE.Save

       End If

   Next oTE

   

   oTEs.CloseDown

   Set oTEs = Nothing

   

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