Thread: Multiciplicity
View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Fabian Fabian is offline
external usenet poster
 
Posts: 21
Default Multiciplicity

Hi,

I've got two user-defined classes, Country and Product. Every product is
sold in every country, therefore the countries should contain a collection of
products (reference) and vice versa.

So I wrote:

*** class product

Public Countries As Collection

Private Sub Class_Initialize()
Set Countries = New Collection
End Sub

Public AddCountry(ByRef c As Country)
Me.Countries.Add c
c.Products.Add Me
End Property

*** class country

Public Products As Collection

Private Sub Class_Initialize()
Set Products= New Collection
End Sub

But that doesn't seem to work at all. What am I doing wrong?

Regards, Fabian


----------------
This post is a suggestion for Microsoft, and Microsoft responds to the
suggestions with the most votes. To vote for this suggestion, click the "I
Agree" button in the message pane. If you do not see the button, follow this
link to open the suggestion in the Microsoft Web-based Newsreader and then
click "I Agree" in the message pane.

http://www.microsoft.com/office/comm...el.programming