britesponge
New member
- Local time
- Today, 13:16
- Joined
- Nov 28, 2015
- Messages
- 2
Hi,
I have three tables in a basic many-to-many setup in order to provide a register for some after school classes.
In this we have a SESSION that can be attended by many children and each CHILD can attend many sessions.
To support this I also have a CHILD_SESSION table containing two columns holding the IDs to the SESSION and CHILD tables.
I have a form where you select the SESSION you wish to register Child records on that has a combo box to select the relevant SESSION and a sub-form that shows the name of the child from the CHILD table where the CHILDID from the CHILD_SESSION table equals the CHILDID from the CHILD table.
All pretty straightforward I think even though Access sure doesn't make it easy.
My problem comes when I want to add another child to the list.
I have set a combo box on the Child name to show the names from the CHILD table so that one can be chosen to add.
However, what happens is that the record added does not show the ID of the CHILD record I chose instead it created a new child record and uses that.
I have tried this by creating the subform first, creating from a query and adding a sub form to the form and I just can't get this to work.
Im more familiar with doing this sort of thing in a 'proper' programming language (for me that is PL/SQL) but the way Access works is stumping me. So after too many tutorial videos and too much forum reading I'm asking the question: What is the correct way to add records to the intersection table while displaying a value from the CHILD table ?
I'm guessing that I could code all this as a VB application but apart from the fact that I don't know VB I also need it to be as Access-only as possible.
Any help would be appreciated.
Many Thanks
BriteSponge
I have three tables in a basic many-to-many setup in order to provide a register for some after school classes.
In this we have a SESSION that can be attended by many children and each CHILD can attend many sessions.
To support this I also have a CHILD_SESSION table containing two columns holding the IDs to the SESSION and CHILD tables.
I have a form where you select the SESSION you wish to register Child records on that has a combo box to select the relevant SESSION and a sub-form that shows the name of the child from the CHILD table where the CHILDID from the CHILD_SESSION table equals the CHILDID from the CHILD table.
All pretty straightforward I think even though Access sure doesn't make it easy.
My problem comes when I want to add another child to the list.
I have set a combo box on the Child name to show the names from the CHILD table so that one can be chosen to add.
However, what happens is that the record added does not show the ID of the CHILD record I chose instead it created a new child record and uses that.
I have tried this by creating the subform first, creating from a query and adding a sub form to the form and I just can't get this to work.
Im more familiar with doing this sort of thing in a 'proper' programming language (for me that is PL/SQL) but the way Access works is stumping me. So after too many tutorial videos and too much forum reading I'm asking the question: What is the correct way to add records to the intersection table while displaying a value from the CHILD table ?
I'm guessing that I could code all this as a VB application but apart from the fact that I don't know VB I also need it to be as Access-only as possible.
Any help would be appreciated.
Many Thanks
BriteSponge