Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 101
Default Let property changing all values in Class module

I have a three tiered Class modules Set up:

clsEVM contains a collection of clsMonths which contains a collection of
clsWBSIDs

In the clsEVM and clsMonths classes, I use the following to set the
underlying classes:

'Set the entire WBSID collection
Property Set WBSIDs(S As Collection)
Set pWBSID = S
End Property

'Get the entire WBSID collection
Property Get WBSIDs() As Collection
Set WBSIDs = pWBSID
End Property

'Get a specific WBSID entry
Public Function WBSID(index As Variant) As clsWBSID
'If numeric, decalre based off index
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
'If string, find appropriate value in collection
For Each WP In pWBSID
If UCase(WP.ChargeCode) = UCase(index) Then
Set WBSID = WP
Exit For
End If
Next

End If
End Function

My problem is that when I use the line:

Me.Month(iMonth).WBSID(sWBSID).ACWP = 5

in the clsEVM module, no matter what imonth is, all instances of sWBSID
found in any particular iMonth are made equal to 5, instead of just the 1
instance in iMonth. So if I have 3 months, and iMonth is = 1, sWBSID for
iMonth = 1, iMonth = 2, and iMonth = 3 will become 5 and I just want iMonth =
1 to equal 5. I can set an object to represent the individual Month in the
class to avoid the confusion, but I thought that was a bit redundant. Thanks
for any help on this. (I searched the MSDN and Chip's site to no avail)

--
*********************
J Streger
MS Office Master 2000 ed.
MS Project White Belt 2003

  #2   Report Post  
Posted to microsoft.public.excel.programming
Tim Tim is offline
external usenet poster
 
Posts: 145
Default Let property changing all values in Class module

Just a guess but have you tried:

Me.Month.Item(iMonth).WBSID(sWBSID).ACWP = 5

(assuming it's a collection)
You don't show any code related to the "Month" property - that would help.

Tim


"J Streger" wrote in message
...
I have a three tiered Class modules Set up:

clsEVM contains a collection of clsMonths which contains a collection of
clsWBSIDs

In the clsEVM and clsMonths classes, I use the following to set the
underlying classes:

'Set the entire WBSID collection
Property Set WBSIDs(S As Collection)
Set pWBSID = S
End Property

'Get the entire WBSID collection
Property Get WBSIDs() As Collection
Set WBSIDs = pWBSID
End Property

'Get a specific WBSID entry
Public Function WBSID(index As Variant) As clsWBSID
'If numeric, decalre based off index
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
'If string, find appropriate value in collection
For Each WP In pWBSID
If UCase(WP.ChargeCode) = UCase(index) Then
Set WBSID = WP
Exit For
End If
Next

End If
End Function

My problem is that when I use the line:

Me.Month(iMonth).WBSID(sWBSID).ACWP = 5

in the clsEVM module, no matter what imonth is, all instances of sWBSID
found in any particular iMonth are made equal to 5, instead of just the 1
instance in iMonth. So if I have 3 months, and iMonth is = 1, sWBSID for
iMonth = 1, iMonth = 2, and iMonth = 3 will become 5 and I just want
iMonth =
1 to equal 5. I can set an object to represent the individual Month in the
class to avoid the confusion, but I thought that was a bit redundant.
Thanks
for any help on this. (I searched the MSDN and Chip's site to no avail)

--
*********************
J Streger
MS Office Master 2000 ed.
MS Project White Belt 2003



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 101
Default Let property changing all values in Class module

The code to declare months in the clsEVM is:

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

Months are only numbered so I don't need to index them by a string value.

As you can see my evm.Month function should return single month, but somehow
even though I return a single month, I affect all months equally.
--
*********************
J Streger
MS Office Master 2000 ed.
MS Project White Belt 2003



"Tim" wrote:

Just a guess but have you tried:

Me.Month.Item(iMonth).WBSID(sWBSID).ACWP = 5

(assuming it's a collection)
You don't show any code related to the "Month" property - that would help.

Tim


"J Streger" wrote in message
...
I have a three tiered Class modules Set up:

clsEVM contains a collection of clsMonths which contains a collection of
clsWBSIDs

In the clsEVM and clsMonths classes, I use the following to set the
underlying classes:

'Set the entire WBSID collection
Property Set WBSIDs(S As Collection)
Set pWBSID = S
End Property

'Get the entire WBSID collection
Property Get WBSIDs() As Collection
Set WBSIDs = pWBSID
End Property

'Get a specific WBSID entry
Public Function WBSID(index As Variant) As clsWBSID
'If numeric, decalre based off index
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
'If string, find appropriate value in collection
For Each WP In pWBSID
If UCase(WP.ChargeCode) = UCase(index) Then
Set WBSID = WP
Exit For
End If
Next

End If
End Function

My problem is that when I use the line:

Me.Month(iMonth).WBSID(sWBSID).ACWP = 5

in the clsEVM module, no matter what imonth is, all instances of sWBSID
found in any particular iMonth are made equal to 5, instead of just the 1
instance in iMonth. So if I have 3 months, and iMonth is = 1, sWBSID for
iMonth = 1, iMonth = 2, and iMonth = 3 will become 5 and I just want
iMonth =
1 to equal 5. I can set an object to represent the individual Month in the
class to avoid the confusion, but I thought that was a bit redundant.
Thanks
for any help on this. (I searched the MSDN and Chip's site to no avail)

--
*********************
J Streger
MS Office Master 2000 ed.
MS Project White Belt 2003




Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
unable to set the values property of the series class BHatMJ Excel Discussion (Misc queries) 4 July 10th 09 03:46 PM
Unable to set the Values property of the Series class rafael garcia Charts and Charting in Excel 1 September 25th 06 04:31 PM
VBA error: Unable to set the Values property of the Series class Marco Shaw Charts and Charting in Excel 1 July 12th 05 02:34 PM
Setting the Values Property of the Series Class Alex A Excel Programming 2 January 30th 04 08:55 PM


All times are GMT +1. The time now is 02:51 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"