You need a third table, SessionPresenters to model the many-to-many
relationship type between Sessions and Presenters. Assuming Sessions and
Presenters have primary key columns SessionID and PresenterID (probably
autonumbers) the new table would have just two columns SessionID and
PresenterID, but not autonumbers this time, just straightforward long integer
number data types. The primary key of SessionPresenters is a composite one
made up of both columns, each of which is a foreign key referencing the
primary keys of the other two tables.
For data entry have a Sessions form in single form view based on the
Sessions table (or better still a query on that table sorted by session title
or whatever order you want the form to show the sessions in) and a subform in
continuous form view based on the SessionPresenters table. The
LinkMasterFields and LinkChildFields properties of the subform control will
both be SessionID.
The subform will contain a combo box set up like this:
Name: cboPresenter
ContrlSource: PresenterID
RowSource: SELECT [PresenterID], [Company], [Title], [Phone Number],
, [Presenter] FROM [Presenters] ORDER BY [Presenter];
BoundColum: 1
ColumnCount: 6
ColumnWidths 0cm;0cm;0cm;0cm;0cm;8cm
If your units of measurement are imperial rather than metric Access will
automatically convert the last one. The important thing is that the first 5
dimensions are zero to hide the first 5 columns and that the last is at least
as wide as the combo box.
If you have FirstName and LastName columns in the Presenters table rather
than a single Presenter column, change the RowSource to:
SELECT [PresenterID], [Company], [Title], [Phone Number], [Email],
[FirstName] & " " & [LastName] FROM [Presenters] ORDER BY [LastName],
[FirstName];
You'll have to change the column names in the above to your actual ones of
course.
Add 4 unbound text boxes to the subform with ControlSource properties of:
=[cboPresenter].[Column](1)
=[cboPresenter].[Column](2)
=[cboPresenter].[Column](3)
=[cboPresenter].[Column](4)
The Column property is zero-based, so Column(1) is the second column
(Company) and so on.
When you select a presenter from the combo box's list the four unbound text
boxes will show the company, title, phone number and email address for the
selected presenter. You can add as many presenters per session simply by
entering a new row for each in the subform.
You can use the form wizards to create the form and subform, then open the
former in design view and embed the latter in it as a subform.
You could create a report/subreport in much the same way of course for
printing out the sessions and their presenters. However, a better way would
be to join all three tables in query, base a report on this and group the
report by session title (or whatever), putting the session data in a group
header and the presenters data in the detail section. Once you've created
the query you can use the report wizard to build the report.
Ken Sheridan
Stafford, England