Well, you can't use the class objects to "build" the relationships for you.
A class object is just a "bunch" of code stuck together, and makes it easer
to code with. So, it don't really help much in terms of a relationship
between a master and child table.
However, you can certainly make a class object that lets you "manipulate " a
member.
dim MyMember as new clsMemberShip
MyMember.Member ID = 123
MyMember.SetAll MembershipsStat us = "InActive"
So, the above code would load a membership person with key id of 123.
Then, to update all the memberships to status to inactive, then you could
use the 2nd line of code.
However, the code in the class object will simply be a bunch of sql
statements, or code that updates the child records.
It is not clear in your example what you mean by "x" in:
Member.Membersh ips(x).Update
I mean, you have to identify each child record some how...likely the key id
field of the child records is the best to use here? It is not the fact that
you want to use "x", but how did x get set to what is the issue here? What,
when, how did "x" get set to select what child record (memberships) to work
on is the issue here.
MyMember.Member ID = 123
MyMember.Member ShipID = 1388
MyMember.Member ShipStats = "Active"
In the above example, I set the Membership status to Active for the
membership record with a key id of 1388.
The code for the property MemberShipID would look like:
Public Property LET (lngMemberShipI D as long)
m_MemberShipID = lngMemberShipID
end Propeirty
The code behind the MembershipStatu s method could look like:
Public Property LET (strStatus as string)
dim sql as string
sql = "update tblMemberships set Status = '" & strStatus & "' where ID =
" & m_MembershipID
currentdb.Execu te sql
end Property
I can't really say that using a class object JUST to work with a one to many
relationship is much help. You can't use class objects in sql, or really
very much in a report. However, a class object certainly can be handy if you
have a LOT of code you are writing that must manipulate, or change the
status of a membership records. If you don't have a lot of code you are
writing to update the membership stuff, then the class object don't help
much.
You can read about "when" and "when not" to use a class object here:
I also give some example usages.
http://www.attcanada.net/%7ekallal.m.../WhyClass.html
--
Albert D. Kallal (Access MVP)
Edmonton, Alberta Canada
pl************* ****@msn.com http://www.attcanada.net/~kallal.msn