Urgent!!  Problem with class module

Posted on 2006-03-20
Last Modified: 2010-04-07
Ok here is what I'm trying to do....this is code I wrote in

    Public Class RateTier
        Public MinimumLTV As Decimal
        Public MaximumLTV As Decimal
        Public MinimumLoanAmount As Decimal
        Public MaximumLoanAmount As Decimal
        Public Fee As Decimal
        Public Rate As Decimal
        Public Apr As Decimal
        Public Margin As Decimal
        Public IndexValue As Decimal
        Public Points As Decimal
    End Class

    Public Class RateProduct
        Public Code As String
        Public Title As String
        Public LoanType As String
        Public Tiers As RateTier()
    End Class

    Public Class RateState
        Public Products() As RateProduct
        Public Abbreviation As String
        Public Label As String
        Public LoanType As String
    End Class

    Public Class RateSystem
        Public States As RateState()
    End Class

    Public Class Rates
        Public EffectiveDate As Date
        Public PrimeRate As Double
        Public Systems() As RateSystem
    End Class

So what this allows me to do is have multiple RateSystem under Rates multiple RateState under RateSystem etc.

So essentially if I wanted to access the property for abbreviation for the first system and first state I would do


If I wanted to access the property for abbreviation for the second system 10th state I would do


and so on...

How do I do something like this in just plain ol' vb6?  
Question by:BofADev
    1 Comment
    LVL 52

    Accepted Solution

    Essentially replace you arrays with collections and expose them through properties in your classes:


      '// Rates class

      Private rateSystem As Collection

      Public EffectiveDate As Date
      Public PrimeRate As Double
      Public Property Get RateSystem
        RateSystem = rateSystem
      End Property

    Hope that made sense.

    Featured Post

    What Is Threat Intelligence?

    Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

    Join & Write a Comment

    Introduction In a recent article ( for the Excel community, I showed an improved version of the Excel Concatenate() function.  While writing that article I realized that no o…
    The debugging module of the VB 6 IDE can be accessed by way of the Debug menu item. That menu item can normally be found in the IDE's main menu line as shown in this picture.   There is also a companion Debug Toolbar that looks like the followin…
    Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
    This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

    729 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    19 Experts available now in Live!

    Get 1:1 Help Now