mferrisi
06-25-2010, 10:33 AM
Hi,
I have created a bunch of objects and indexed them in a collection. I am able to return the properties of the objects by
oEmployeeColl(4).Name but am unable to return object properties that are arrays. For clarifiction, I have a collection
Public oEmployeeColl As New Collection is the collection of employees.
That has a bunch of objects indexed on it
Sub Add_Employee_Info(EmployeeNum, ByRef Name As String, ByRef Type As String, ByVal DTime As Date, RTime As Date)
Dim oEmployee As Employee
Set oEmployee = New Employee
oEmployee.AddEmployee EmployeeNum, Name, Type, DTime, RTime
oEmployeeColl.Add oEmployee
The objects were created in a class module called Employee
Public EmployeeName As String
Private DispatchReturn()
Public Function AddEmployee(sEmployeeNum, ByVal Name As String, Type As String, DTime As Date, RTime As Date)
ReDim DispatchReturn(1 To 1, 1 To 4)
EmployeeName = Name
DispatchReturn(1, 1) = sEmployeeNum
DispatchReturn(1, 2) = Name
DispatchReturn(1, 3) = DTime
DispatchReturn(1, 4) = RTime
End Function
So now, oEmployeeColl(1).Employee name returns the name,
but I can't get oEmployee(1).DispatchReturn(1,3)
I have created a bunch of objects and indexed them in a collection. I am able to return the properties of the objects by
oEmployeeColl(4).Name but am unable to return object properties that are arrays. For clarifiction, I have a collection
Public oEmployeeColl As New Collection is the collection of employees.
That has a bunch of objects indexed on it
Sub Add_Employee_Info(EmployeeNum, ByRef Name As String, ByRef Type As String, ByVal DTime As Date, RTime As Date)
Dim oEmployee As Employee
Set oEmployee = New Employee
oEmployee.AddEmployee EmployeeNum, Name, Type, DTime, RTime
oEmployeeColl.Add oEmployee
The objects were created in a class module called Employee
Public EmployeeName As String
Private DispatchReturn()
Public Function AddEmployee(sEmployeeNum, ByVal Name As String, Type As String, DTime As Date, RTime As Date)
ReDim DispatchReturn(1 To 1, 1 To 4)
EmployeeName = Name
DispatchReturn(1, 1) = sEmployeeNum
DispatchReturn(1, 2) = Name
DispatchReturn(1, 3) = DTime
DispatchReturn(1, 4) = RTime
End Function
So now, oEmployeeColl(1).Employee name returns the name,
but I can't get oEmployee(1).DispatchReturn(1,3)