A list within a list (1 Viewer)

MatthewB

Member
Local time
Yesterday, 16:32
Joined
Mar 30, 2022
Messages
85
Here we go again :)

I have a form with a subform in a parent child relationship.
The subform is a list of tasks associated with a building. (wash the windows, fix a hole in the wall kind of thing). I want each task to have a collection of notes - short texts. This way I can make notes of conversations related to the task, over the life of the task. What is the best way to build this relationship? Ideally I would have a button within the task list that opens a task note list form (a continuous form). I have tried the usual one to many relationship relationships but it did not work.

Thanks
 

Pat Hartman

Super Moderator
Staff member
Local time
Yesterday, 19:32
Joined
Feb 19, 2002
Messages
43,217
Did not work is less than helpful as a description. If you are talking about setting the FK in the popup form, you MUST do it yourself. The best place is the popup form's BeforeInsert event. Pass in the value using the OpenArgs parameter of the OpenForm method

Me.SomeFK = Me.OpenArgs
 

MajP

You've got your good things, and you've got mine.
Local time
Yesterday, 19:32
Joined
May 21, 2018
Messages
8,525
I would do linked continuous forms as @June7 describes; however, this is one case where you could get away with subdatasheets. I would only do that if you are showing very few fields in both the parent and child. Build two queries for what you want to show. You will need to include the linking field. In the Task query in design view modify the subdata sheet properties
subdata properties.jpg

Subdatasheet.jpg


You can also do this in a treeview especially if you are going down more than one level. However, that is kind of a varsity level skill

Treeview.jpg
 
Last edited:

Pat Hartman

Super Moderator
Staff member
Local time
Yesterday, 19:32
Joined
Feb 19, 2002
Messages
43,217
I tried the sub data sheets for one app. It is cool but very confusing to the eye.
 

Users who are viewing this thread

Top Bottom