Hi guys,
I am trying to loop through all the elements of my class array using the following
Dim QueryField as cQueryField
Dim k as integer
Set QueryField = New cQueryField
'POPULATE THE CLASS OBJECT ARRAY
For k = LBound(myArray,2) to UBound(myArray,2)
QueryField.PlantMake(k) = myArray(k,2)
Next k
'LOOP THROUGH THE CLASS OBJECT ARRAY AND DEBUG PRINT THE VALUES
for i = UBound(QueryField.AllPlantMakes) To UBound(QueryField.AllPlantMakes)
Debug.Print QueryField.AllPlantMakes(i)
Next i
Class
My Class looks like the following:
Private pAllPlantMakes
Private Sub Class_Initializ()
ReDim pAllPlantTypes(0)
End Sub
Public Property Get AllPlantMakes() as String()
AllPlantMakes = pAllPlantMakes
End Property
Public Property Get PlantMake(index as Long) as String
PlantMake = pAllPlantMakes(index)
End Property
Public Property Let PlantMake(index as Long, strValue as String)
If index > Ubound(pAllPlantMakes) then ReDim Preserve pAllPlantMakes(index)
pAllPlantMakes(index) = strValue
End Poperty
I keep receiving an error on the line: for i = UBound(QueryField.AllPlantMakes) To UBound(QueryField.AllPlantMakes)
Why cant I loop through this 'class' array?
Regards
Jordan
Bookmarks