SurreyNick
Member
- Local time
- Today, 03:19
- Joined
- Feb 12, 2020
- Messages
- 127
I’d like to get some advice on a good way to approach the coding for a form which will enable users to add a new exam to my db.
Adding a new exam involves adding data to three tables (ExamPapers, Questions and GradeBoundaries), all of which require inclusion of the PK from at least one other table. Two of the three tables (Questions and GradeBoundaries) also need to include the PK of the first table (ExamPapers). I have highlighted this on the attached pic. In light of this I assume the first task will be to populate data into the ExamPapers table and once this has been done populate the GradeBoundaries and Questions tables with the information pertaining to the new exam. When it comes to making choices for the FKs in the three tables I will have to provide the users with combo boxes.
I haven’t used tabbed controls anywhere in my db so I’d rather avoid doing so for this form too. With this in mind the only way I can conceive of approaching this task is to use text boxes on the parent form to populate the first table (tblExamPapers) and to have two subforms, both in continuous forms mode to populate the other two tables (tblGradeBoundaries and tblQuestions).
Coding-wise the only procedure I can think of is to force users to first populate the text boxes on the parent form in sequence and using an after update event on the last field execute a SQL statement to populate the ExamPapers table and at the same time create two temporary tables one for GradeBoundaries and one for Questions both linked to the subforms. Once these are populated use a command button to execute SQL statements to append the data to the main tables and delete the temporary tables.
Do you think this is the best approach?
Thanks.
Nick
Adding a new exam involves adding data to three tables (ExamPapers, Questions and GradeBoundaries), all of which require inclusion of the PK from at least one other table. Two of the three tables (Questions and GradeBoundaries) also need to include the PK of the first table (ExamPapers). I have highlighted this on the attached pic. In light of this I assume the first task will be to populate data into the ExamPapers table and once this has been done populate the GradeBoundaries and Questions tables with the information pertaining to the new exam. When it comes to making choices for the FKs in the three tables I will have to provide the users with combo boxes.
I haven’t used tabbed controls anywhere in my db so I’d rather avoid doing so for this form too. With this in mind the only way I can conceive of approaching this task is to use text boxes on the parent form to populate the first table (tblExamPapers) and to have two subforms, both in continuous forms mode to populate the other two tables (tblGradeBoundaries and tblQuestions).
Coding-wise the only procedure I can think of is to force users to first populate the text boxes on the parent form in sequence and using an after update event on the last field execute a SQL statement to populate the ExamPapers table and at the same time create two temporary tables one for GradeBoundaries and one for Questions both linked to the subforms. Once these are populated use a command button to execute SQL statements to append the data to the main tables and delete the temporary tables.
Do you think this is the best approach?
Thanks.
Nick