title: Class of a Class
body: <p>I'm getting just killed trying to make a class of a class. I have shopped around the site and seen several examples but maybe because its 1:43 I am having a hard time understanding them.</p>
  
  <p>I was successfully able to use a class to automate a huge data entry project at work. I created a class called catDist which is the category distribution of types of agricultural products a company could manufacture or sell.</p>
  
  <p>catDist contains six properties:
    Private selfWorth As String
    Private Q1 As Double
    Private Q2 as Double
    Private Q3 as Double
    Private Q4 As Double
    Private activated As Boolean </p>
  
  <p>They all have the standard get and let codes.</p>
  
  <p>There are 48 possible categories. I have a module that creates 48 instances of them with 48 different values for selfWorth (e.g "Cottonseed", or "maize" etc), and sets Q1 through Q4 as 0 .  The module originally worked with a Userform that I could type in the values and hit enter. If it saw that I had entered a value inside a particular textbox (yes there were 48X4 textboxes) it would set activated to true and changes the relevant Q's to the values I entered.</p>
  
  <p>WHAT I WANT TO DO NOW.</p>
  
  <p>It was a great success. Now what I want to do is create a class called "Distributor". Each distributor class would have 4 collections have catDist objects. I can create the distributor class. I can create the catDist class. But for the love of God I can not figure out a way to set the corresponding distributor catDist property to the catDist value I used in the Set method. </p>
  
  <pre><code>Sub testRegist()
  Dim registrant As testRegistrant
  Set registrant = New testRegistrant
  
  registrant.registNum = "Z000123"
  'MsgBox (registrant.registNum)
  
  Dim cowMilk As testcatDist
  Set cowMilk = New testcatDist
  
  cowMilk.selfWorth = "Cow Milk"
  cowMilk.distribution = 4.6
  
  registrant.testCat = cowMilk
  
  Debug.Print registrant.testCat.selfWorth
  
  End Sub
  </code></pre>
  
  <p>catDist Class</p>
  
  <pre><code>Private pselfWorth As String
  Private pdistribution As Double
  
  Public Property Get selfWorth() As String
    selfWorth = pselfWorth
  End Property
  
  Public Property Let selfWorth(name As String)
   pselfWorth = name
  End Property
  
  Public Property Get distribution() As Double
     distribution = pdistribution
  End Property
  
  Public Property Let distribution(dist As Double)
    pdistribution = dist
  End Property
  </code></pre>
  
  <p>Registrant a.k.a distributor class</p>
  
  <pre><code>Private pRegistNum As String
  Private pCatDist As testcatDist
  
  Public Property Get registNum() As String
      registNum = pRegistNum
  End Property
  
  Public Property Let registNum(registration As String)
    pRegistNum = registration
  End Property
  
  Public Property Get testCat() As testcatDist
     testCat = pCatDist
  End Property
  
  Public Property Let testCat(cat As testcatDist)
     Set pCatDist = New testcatDist
     pCatDist = cat
  End Property
  </code></pre>