Link to home
Start Free TrialLog in
Avatar of OtterMouse
OtterMouse

asked on

Subform from a junction table

Hi
I am developing a contacts database and need to have a method of inviting people to events.
I have a 2 tables
'events'
'person'
and have made a many to many relationship between them by creating a new table
'event_person junction'

I have a main form
'person details' whose record source is persontbl
and then a subform within the main form called events whose record source is event_person junctiontbl where the events are listed and there are yes/no tick boxes to invite. This works well with the existing records, however, when i add a new person on the main form the junction table does not add events records and therefore the subform doesn't work

How do i get round this? Have i done this in the best way to start with?

All help gratefully received
Cheers
ASKER CERTIFIED SOLUTION
Avatar of MikeToole
MikeToole
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Compare with this idea:

persons (pID, ...)
events (eID,...)
person_event (pID, eID, ...)

Form: persons (pID, ...)
SubForm events: Record source a EventQuery (pId, eID, eName, ...) using events and person_event tables
Linked fields: pID
Avatar of OtterMouse
OtterMouse

ASKER

Thanks for your replies, i don't have the opportunity to try the solutions yet but will do tomorrow and let you know how i get on.

Thanks for your solution, you picked up exactly what i was after and gave me an easy to understand and implement solution. I went with the first solution - much cleaner in the long term i think.