Forms, Sub Forms and Sub Sub Forms Advice

mattyn

Board Regular
Joined
Apr 20, 2015
Messages
148
Good Afternoon All

I am building a Db for a school that runs many courses. Each course can have many classes. Students can be enrolled on many courses, and maybe on many classes should they fail first time round. A student may repeat a course on another class should he fail the exam, for instance.

This database under construction utilises the following tables.

tblRank (a list of the ranks of each student - forms the basis of a cbo for the tblStudent.
tblStudent (a standard list of all Student data).
tblCourses (all the data per course we deliver - each course has a code number and a title.)
tblCourseDelivery (a table of all classes of each course we deliver. Some courses only have one class delivered each year, some have 12 classes per year annotated 01/16, 02/16, 03/16 etc).
tblStudentEnrolment (which student is on which course and in which class).

Current relationships are as follows - the pic is cut off on the right, but all tables are visible.

2016_07_21.png


I want to be able to load students into course classes by either the course or student form, therefore from those tables, I have created the following:

frmtblStudentMain - This is a direct form adaption of tblStudent - created using the wizard as a columnar form

subfrmtblStudentEnrolment - a sub form added to frmtblStudentMain and linked by StudentID, This shows and can update all the course classes a student in on (enrolled). It is tabular (continuous) as I want to see all the classes a student is enrolled in.

frmCoursesMain - a direct form adaption of tblCourses - created using the wizard as a columnar form. In this form underneath the columnar stuff, I created a tab controlled sub form, with two tabs.

tab 1 - subfrmCourseDelivery - linked by CourseID, it is used to create each individual class for each course. Is in tabular format to show each class on the course page of the frmCoursesMain. I will use this to create classes within each course.
tab 2 - subfrmCourseloader - a columnar version of subfrmCourseDelivery as I want a sub-subform to be able to load students onto each class. It is adding this sub-subform that I am having snags with.

I thought I had this sorted but it appears I have duplication of data. Should StudentA repeat course A by attending and failing Class 01/16 and then be enrolled in Class 02/16, and I complete this on the frmStudentMain and subfrmtblStudentEnrolment form his data is duplicated in subfrmCourseLoader (i.e. there appears to be two records). I have, obviously, class 01/16 is only unique when linked with the courseID.

I am using a subform within a subform within a form, and this is causing an issue - or is it, as I think probably, I am just simply not linking it correctly.

Can anyone offer a suggestion on how to make these forms do what I want? I am happy to start again to a certain extent, as this is a good learning experience for me, but I do want and need two ways of loading and viewing students that are on onto courses.

Thoughts, suggestions, advice much appreciated. I really hope all this makes sense!!

Many, many thanks in advance.


Matt
 
Last edited:

Excel Facts

Will the fill handle fill 1, 2, 3?
Yes! Type 1 in a cell. Hold down Ctrl while you drag the fill handle.
Hi Matt

It has been a while since I have done any major development in MS Access, but have a look at your relationships, I don't think you should have CourseID as a relationship between courses and enrolment.

I would go from enrolment-delivery-courses.

Regards

Dave
 
Upvote 0
Dave

That was a quick reply - thank you.

Are you saying that the extra relationship line from tblCourses to tblStudentEnrolment would cause that duplication?

If so, what a div I am!!

Matt
 
Upvote 0
Yes

If you follow it through as you currently have your relationships

In the enrolment table you have CourseID which is picking up the course details from the courses table, but you also have CourseDeliveryID (within which has a courseID linking to the courses table.

Thefore you have within enrolment

Courses & CourseDelivery!Courses

Resulting in the apparent duplication.

I hope that makes some sort of sense!!

Regards

Dave
 
Upvote 0
Hi

I managed to solve it. I deleted that "rogue" relationship and found some errant data in the tables. Created the new sub-sub form and all seems sorted

I just can't add data to the sub-sub form (which is in effect adding a student to a course). I just need a defined method which is ok for now, and work the easier functionality later.

Matt
 
Upvote 0
Yes.

I have frmCourse as the main, then a tabbed form with two tabs, one is a sub form of course delivery that allows classes to be created, the other is again course delivery (but abriged) - no editing - but has a sub-sub form of Student Enrolment details.

Matt
 
Upvote 0
I have set up a rough model of what you are try to achieve, and if you you select delivery in the sidebar and create a form using the form wizard, add the fields from delivery and enrolment tables and it should work.
 
Upvote 0
Wow thank you. You referring to my tables?

That will be really helpful.

Again thank you.

Matt
 
Upvote 0

Forum statistics

Threads
1,214,583
Messages
6,120,380
Members
448,955
Latest member
BatCoder

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top