First, be sure to create the relationships between the three tables. If
you need help with that, post again.
This is the basic structure of the forms, assuming the tables and queries
are described:
There is a main form frmBoardName based on the BoardName table, with a
subform fsubJunction (I would call the junction table by a more
descriptive name such as BoardMembership, and likewise the subform, but
that's up to you, as are any of the suggested names).
To build a subform, build it as you would any other form, using the query
as suggested (including my remark to add BoardMemberID). Create a combo
box on fsubJunction. Set its RecordSource to Board_MemberID. Set its Row
Source to a query based on tblBoard_Member. When you build the query, set
its first column to BoardMemberID and its second column to something like:
LastFirst: [LastName] & ", " & [FirstName]
Save the query, giving it a name. Choose the named query as the Row
Source. Set the combo box Bound Column to 1 (the Data tab of the Property
Sheet). On the Format tab of the Property Sheet, set the Column Count to 2
and the Column Widths to something like 0";1.5".
Open the main form frmBoardName in design view. Use the toolbox to add a
Subform Control. Set the Subform Control's Source Object (Data tab of the
Property Sheet) to fsubJunction. Click into Link Child or Link Master,
and click the three dots on the right. If the tables are properly related
Access should suggest the correct linking fields (BoardNameID).
Note that you will need to build a list of Members, using a separate form
bound to the BoardMembers table, before you can select them from the combo
box on the subform.
An easy way to assure you do not have duplicate names in the listing of
members is to create an index on the combination of BoardMemberID and
BoardNameID in the junction table. See Help on the topic "Prevent entry
of duplicate values (MDB)" to see how to create an index on more than one
field.
Note that with this structure you can see different boards by scrolling
through the main form records, but not by selecting a board name. To do
that you need a separate unbound combo box. The combo box wizard in the
toolbox can help with that. To use the wizard, be sure the magic wand
icon is highlighted before clicking the combo box icon.
If you want to record the date appointed, add a Date/Time field to the
junction table, and to the subform.
I'm not sure what you are asking as regards different dates that a single
member is appointed to a board, but you do not need a table of dates that
I can see.
NotGood@All said:
Thank you both. This is confusing but fun. I will play with the combo
box,
it will be nice to select a board and have all the members show up. One
more question, members can be appointed to a board more than 1 time, so I
can
have member 1 appointed to board 1 on 3 different dates and appointed to
boards 2 & 3 on different dates. My thinking is that I need a table of
dates
with a 1 to many relationship between the Board_Name, is that correct??
--
NotGood@All
:
The subform query will also need Board_MemberID from Junction_Table.
Typically the subform will have a combo box bound to Board_MemberID from
Junction_Table. The combo box Row Source will be from Board_Member,
with
Board_MemberID the bound column, and then maybe LastName and FirstName
concatenated as the second column. The first column is hidden.
Your tables should look like this .........
Board_Name
Board_NameID
Board_Name
Board_Member
Board_MemberID
FirstName
LastName
etc
Junction_Table
Junction_TableID
Board_NameID
Board_MemberID
1. Create a query named QrySFrmBoardMembers. Include the
Board_Member
table and the Junction_Table table. Include FirstName, LastName from
Board_Member and Board_NameID from Junction_Table.
2. Create a form/subform. Base the main form on Board_Name table
and
base the subform on QrySFrmBoardMembers. Make the main form single and
the
subform continuous.
3. Open the main form in design view. Open Properties, go to the
Data
tab and set LinkMaster and LinkChild to Board_NameID.
When you open the mainform, you will get a Board Name and a list of
members of that board. You can navigate to ny board name by clicking
on an
appropriate Navigation Button at the bottom left of your screen.
Steve
I want to set up a database for boards and members of those boards.
It is
a
many to many relationship so I have 3 tables, Board_Members,
Board_Name,
and
a table named Junction Table. The Junction Table has a many to 1
relationship with both the Board_Name and Board_Members tables. I'm
trying
to create the input screen but can't get it to work right. I would
like
a
dropdown box so when I change the name of the board, the members of
that
board change with it. Can someone walk me through it??
Thanks