Access ADP, Office 2003.
I have clsVehicle which is my own class for a vehicle.
I want to fill an array of these vehicles.
Dim arrFleet() As clsFleet
So in my code, I count how many vehicles there are. Then I redim the array to that size.
ReDim arrFleet(iVehicle_Count)
If I then try
Debug.Print arrFleet(1).RegNo
I will get an error:
"Object variable or With block variable not set"
Now, I can around this with:
For iLoop = 0 To (iVehicle_Count - 1)
Set arrFleet(iLoop) = New clsFleet
Next
But this seems a bit awkard. Is there a better way?
Something I should put in my class, or another way to declare the array?
Thanks
Start Free Trial