Public Sub LoopProductInfo()
''List the default debit accounts for a specific product ID

    Dim oProduct As IBBProduct
    Set oProduct = New cProduct
    oProduct.Init FE_Application.SessionContext
    oProduct.Load 36 ''Sample database product ID = HP
    ''User defined Product ID and Description
    Debug.Print oProduct.Fields(PRODUCTS_fld_USERDEFINEDID) & " - " & oProduct.Fields(PRODUCTS_fld_DESCRIPTION)

    Dim oDist As IBBDistribution
    For Each oDist In oProduct.Distribution
        Debug.Print "====="
        Debug.Print "Sequence: " & oDist.Fields(BBDISTRIBUTIONS_fld_SEQUENCE) ''Sequence in distribution list
        Debug.Print "Percentage: " & oDist.Fields(BBDISTRIBUTIONS_fld_PERCENT) ''Percentage of distribution for account
        Debug.Print "Debit A/C: " & oDist.Fields(BBDISTRIBUTIONS_fld_DEBITACCTNUM) ''Debit Account number
    Next oDist

    Set oDist = Nothing

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