multi-sibling subforms issue

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have 3 sibling subforms (fsubClassList, fsubClassStudentList,
fsubClassDayTime) in an unbounded main form.

fsubClassStudentList and fsubClassDayTime subforms are linked to
fsubClassList using Child/Master Link

txtClassID field (=fsubClassList.Form.cid) is used to link subforms


liking 1 (either fsubClassStudentList or fsubClassDayTime ) to
fsubClassList, it works properly. But linking 2 subforms to fsubClassList,
the main form shows "Calculating..." at the bottom left corner and keep
refreshing the form.

Could anyone help me solve this problem?

Thanks in Advance.

Daniel Yang
 
Access does not permit linking a "list view" subform to a parent form which
is also a "list view" I suspect that to be what you are trying to do.

Here is how I would set it up. I've changed the names of the tables and
form a bit to make it a bit easier to follow (I think)

tbl_COURSE describes a course, e.g. Access 101, Geometry II, etc.
CourseID - PrimaryKey
CourseTitle
etc.

tbl_Enrollment
CourseID_FK
Student_FK
these two columns TOGETHER make up
the PK of this table

Student_FK presumably points to a student record. If students don't enroll
in multiple courses, then put all student info here.

tbl_Schedule
CourseID_FK
ScheduledTime (date/time)
these two columns TOGETHER make up
the PK of this table

Presumably the course is given in several sessions, such as every Tuesday
and Thursday at 7:00PM etc. over the span of several weeks.

Now with those tables, we need some forms...

Course Form
record source: tbl_COURSE

this form displays a SINGLE row from tbl_COURSE at a time

subform_ENROLLMENT
link parent field: Course.CourseID
link child field : CoursID_FK

list view (also known as continuous or multi-row)

subform_SCHEDULE
link parent field: Course.CourseID
link child field : CourseID_FK

list view (also known as continuous or multi-row)

---


Now, after you get this working, if you absolutely must have a list view of
the course master aswell, you will have to do a bit of work:

Create MAIN as a list view. Display the list of courses.

Make the form's footer about 1/2 of the height of the form to start with.
Put the form "Course" above in the FORM FOOTER of MAIN, calling it
subform_COURSE. Do NOT attempt to establish Parent/Child relationship.
Optionally hide (set each field bound to "COURSE" to have VISIBLE = FALSE,
especially do not delete COurseID. Essentially you only want to display the
two subforms, presumably side by side.

In the new MAIN form, in the Form_Current event, change the FILTER property
of the COURSE subform to reflect the value of the CourseID of the currently
active row, like this:

Private Sub Form_Current()
Me.subform_COURSE.Filter = Me.CourseID
End Sub

You may have to add code somewhere to handle adding/deleting a course etc.,
but this should get you going.
 
the parent form in the op's post is unbound. the link is between multiple
subforms. if by "list view" you mean ContinuousForm view or Datasheet view,
then yes, it is entirely possible to link two subforms on the same mainform,
where the controlling subform is either ContinuousForm or Datasheet view, as
well as the controlled subform.

hth
 
Agreed. But his continuous "Calculating..." in the status bar indicates that
somethng else is going on, possibly recursive, that is causing a problem. So
I felt it prudent to offer the suggested mechanism. There are others, of
course. (no pun intended.) (Well, maybe.)
 
I solved the problem with your answer.
Thank you NKTower for your "easy-to-follow" reply :)

Daniel
 

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

Back
Top