J
J Streger
I have a class module that has a collection of another class module (MONTH)
that has a collection of a third class module (WBSID) with a property of
ACWP. It seems that in some scenarios, if I call this line in the top level
class:
Me.Month(1).WBSID("ABC123").ACWP = 50
All WBSID with the name property of "ABC123", regardless of which month they
are in, chance to 50, even though I specifically call one month. And I just
want to set the single month's value, not any other month. Below is the code
that refers to this in my classes (sorry for lack of comments, haven't gotten
around to it). Thanks for any help as this is driving me nuts.
Top Level Class:
Private pMonth As New Collection
Property Set Months(S As Collection)
Set pMonth = S
End Property
Property Get Months() As Collection
Set Months = pMonth
End Property
Public Function Month(index As Integer) As clsMonth
If index > pMonth.Count Or index < 1 Then
Err.Raise 9
Else
Set Month = pMonth(index)
End If
End Function
Month class:
Private pWBSID As New Collection
Property Set WBSIDs(S As Collection)
Set pWBSID = S
End Property
Property Get WBSIDs() As Collection
Set WBSIDs = pWBSID
End Property
Public Function WBSID(index As Variant) As clsWBSID
If IsNumeric(index) Then
If index > pWBSID.Count Or index < 1 Then
Err.Raise 9
Else
Set WBSID = pWBSID(index)
End If
Else
Dim WP As clsWBSID
For Each WP In pWBSID
If UCase(WP.ChargeCode) = UCase(index) Then
Set WBSID = WP
Exit For
End If
Next
End If
End Function
WBSID Class:
Private pACWP As Double
Private pChargeCode As String
Public Property Let ChargeCode(S As String)
pChargeCode = S
End Property
Public Property Get ChargeCode() As String
ChargeCode = pChargeCode
End Property
Public Property Let ACWP(S As Double)
pACWP = Round(S, 1)
End Property
Public Property Get ACWP() As Double
ACWP = pACWP
End Property
--
*********************
J Streger
MS Office Master 2000 ed.
MS Project White Belt 2003
User of MS Office 2003
that has a collection of a third class module (WBSID) with a property of
ACWP. It seems that in some scenarios, if I call this line in the top level
class:
Me.Month(1).WBSID("ABC123").ACWP = 50
All WBSID with the name property of "ABC123", regardless of which month they
are in, chance to 50, even though I specifically call one month. And I just
want to set the single month's value, not any other month. Below is the code
that refers to this in my classes (sorry for lack of comments, haven't gotten
around to it). Thanks for any help as this is driving me nuts.
Top Level Class:
Private pMonth As New Collection
Property Set Months(S As Collection)
Set pMonth = S
End Property
Property Get Months() As Collection
Set Months = pMonth
End Property
Public Function Month(index As Integer) As clsMonth
If index > pMonth.Count Or index < 1 Then
Err.Raise 9
Else
Set Month = pMonth(index)
End If
End Function
Month class:
Private pWBSID As New Collection
Property Set WBSIDs(S As Collection)
Set pWBSID = S
End Property
Property Get WBSIDs() As Collection
Set WBSIDs = pWBSID
End Property
Public Function WBSID(index As Variant) As clsWBSID
If IsNumeric(index) Then
If index > pWBSID.Count Or index < 1 Then
Err.Raise 9
Else
Set WBSID = pWBSID(index)
End If
Else
Dim WP As clsWBSID
For Each WP In pWBSID
If UCase(WP.ChargeCode) = UCase(index) Then
Set WBSID = WP
Exit For
End If
Next
End If
End Function
WBSID Class:
Private pACWP As Double
Private pChargeCode As String
Public Property Let ChargeCode(S As String)
pChargeCode = S
End Property
Public Property Get ChargeCode() As String
ChargeCode = pChargeCode
End Property
Public Property Let ACWP(S As Double)
pACWP = Round(S, 1)
End Property
Public Property Get ACWP() As Double
ACWP = pACWP
End Property
--
*********************
J Streger
MS Office Master 2000 ed.
MS Project White Belt 2003
User of MS Office 2003