many to many

B

Burt

Hi,

I want to create a database that list researchers and their asscociated
subjects (can be more than one). I guess the design would be in the shape of
a many to many relationship. 1 table for researchers, 1 table for subjects
and a junction table to bring them both together.

My question is, how do I create a form that allows my to look at a
particular researcher and choose the different subjects that he/she is
associated with, maybe as an option group?

Many thanks
 
S

Stefan Hoffmann

hi Burt,
My question is, how do I create a form that allows my to look at a
particular researcher and choose the different subjects that he/she is
associated with, maybe as an option group?
You need to manipulate the junction table.

To display the the subjects per researcher you need a main form based on
your researchers table. For the subjects you need a view which joins the
junction table with the subject table. This view is displayed in the sub
form which is connected to the main form via the junction tables
researcher value.

I would now use to buttons Add Subject and Delete Subject.

Add Subject opens a dialog for selecting a subject. After you have the
selected subjects ID you insert it into the junction table with the
researchers id.

The delete button simply deletes the researcher/subject pair from the
junction table.

Hope that helps.

mfG
--> stefan <--
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top