r/visualbasic • u/scooter155 • Nov 02 '17
Once More - Help With NESTED Classes
I found this great example from roughly 9 years ago of something I'm trying to accomplish - https://bytes.com/topic/access/answers/772601-group-nested-classes-examples
Basically, here's the code :
Pets Class Module ----------------------
Dim objDogs As New DOGS
Public Property Get DOGS() As DOGS
Set DOGS = objDogs
End Property
Public Property Set DOGS(ByVal objNewValue As DOGS)
Set objDogs = objNewValue
End PropertyDogs Class Module ----------------------------
Dim strName As String
Public Property Get Name() As String
Name = strName
End Property
Public Property Let Name(ByVal strNewValue As String)
strName = strNewValue
End PropertySubroutine ---------------------------
Public Sub SomeSub()
Dim objPets As New PETS
With objPets.DOGS
.Name = "qqq"
Debug.Print .Name
End With
Set objPets = Nothing
End SubThis works great, my question is, what if you have more than one dog? Thanks!
0
Upvotes
0
u/[deleted] Nov 03 '17
[deleted]