Public Sub CreateBank()

    Dim oBank As CBank
    Set oBank = New CBank
    oBank.Init REApplication.SessionContext
    With oBank
        .Fields(BANK_fld_ACCOUNT_NAME) = "Test account"
        .Fields(BANK_fld_ACCOUNT_NO) = "12345"
        .Fields(BANK_fld_BANK) = "Bank of the Nation"
        .Fields(BANK_fld_BRANCH_NAME) = "State Street Branch"
    End With
    Debug.Print oBank.Fields(BANK_fld_ID)
    Set oBank = Nothing
End Sub

If a code table entry for the Bank name does not already exist in the TABLEENTRIES table, then please add the record using the code sample below.

Public Sub CreateTableEntry()

    Dim oTableEntry As CTableEntry
    Set oTableEntry = New CTableEntry
    oTableEntry.Init REApplication.SessionContext
    With oTableEntry
        .Fields(tableentry_fld_LONGDESCRIPTION) = "My New Bank Name"
        .Fields(tableentry_fld_CODETABLESID) = "5087"
    End With
    Debug.Print oTableEntry.Fields(tableentry_fld_SEQUENCE)
    Set oTableEntry = 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.