How to Link Continuous Forms (1 Viewer)

Status
Not open for further replies.

gemma-the-husky

Super Moderator
Staff member
Local time
Today, 01:18
Joined
Sep 12, 2006
Messages
15,614
Here is an example of a way to be able to have a continuous form, with a linked subform, also continuous.

you can have a subform linked to a main form, where the main form is a single form. in such cases, access automatically manages the linking field for oyu, and no code is needed at all. however, if you want the main form to be continuous you need a slightly different approach.


I do this by having two subforms within a container form. The master (let's say left ) subform , and the sub (let's say right) subform

The way I do it is to use the current event of the left subform to requery the right subform, so that the items shown in that subform display correctly, as you cannot do that automatically with a continuous main form.

you also need the before update event of the right sub form, to set the detail for the link, as this isn't done automatically.

I think I was shown a way to do all this directly, without needing even this small amount of code, but I cannot recollect the exact method.

----
so the example in the demo manages students, courses, and the courses on which each student is enrolled.

it uses a container form, in which there is a continuous form for the students, and for the courses on which each student is enrolled. (I also put a courses form inside this container form, for simplicity).

There is a very small amount of code used to manage the display, as the user selects a different student. As I say, I think there is a way to do this without needing even this code.

in this example, the students and courses forms use the tables directly, so won't be sorted. It would be better to use a query to get them sorted alphabetically.


View attachment demo_continuous.zip
 
Status
Not open for further replies.

Users who are viewing this thread

Top Bottom