Multiple levels af data in forms

svjensen

Registered User.
Local time
Today, 17:11
Joined
May 6, 2010
Messages
37
I need to present several levels of data in a form, but am having trouble when I exceed two levels.

I have made a rude example, which can be found here: http://www.vinther-jensen.dk/access/several_levels.mdb

In the form 'frmListe simpel' there is an example of how I wish to be able to choose a given value in a list box, which then defines the data presented in the sub form. This work fine.

The problem is when I try to add a third level. In the form 'frmListe kompleks' I have begun work on this.
My first problem is that I cannot get the content in the list box to follow the selection at 'master' level.
I am thinking that using a query might be the way to go, but I am uncertain of how to set it up.

The next problem is that the sub form must still work as in 'frmListe simpel'.

/Søren
 
Create one table with the fields:
id: autonumber
parentid: long
titel: text

Now you can create an unlimited number of levels. Toplevel is the id where parentid is null.

HTH:D
 
I've been using text boxes to link multiple subforms together. So at each level you need a matching text box on the main form whose control source is the unique identifier of each subform. then you can use these as your master links, and the matching fields in the subforms as children.
 
Guus2005,

I am not quite sure that I follow you.
The table that you describe is - as far as I can see - identical to my 'Child' table.

Could you expand a bit on how you see it used?

/Soren
 
James,

If I understand you correct, you then update the text box on the main form with the selection in a given subform. And then use the updated text box as the driver for updating an other sub form.
Is that correctly understood?

/Soren
 
Yeah, pretty much - I can't follow the link to your database from work but I assumed you were doing the same thing as me - select a record in subform A and have the data change to match in subform B, then select a record in subform B and have matching data pop up in subform C and so on....

So, to make them link together, create the text box and set its control source to "=[subform object name].form![Unique Field Name]" - obviously substitue your own form and field names in. Then, as you change records in the subform, you'll see the text box value change. Name the text box as level_1_link or something, and set the master field link on your second subform to the name of the text box, and the child field link to the matching field in the second subform.

That's how I usually display greater levels of detail for something, anyway.
 
James (#6),

That is exactly what I am trying to do. I will give the linked text box approach a try. Thanks.

Cheers, Soren
 
Nice one - as far as I know it's the only way, if there's any other solutions I'd be thrilled to know!

Good weekend all!
 
For you info, James, I have updated the example (still same link as original), which now works without the linked text box.
It is still a rude example and the linked text box might be better suited for more complex structures.

Cheers, Soren
 
Yeah, it's really only when you're controlling one subform from another, but handy to know. Good luck!
 
Guus2005,

I am not quite sure that I follow you.
The table that you describe is - as far as I can see - identical to my 'Child' table.

Could you expand a bit on how you see it used?

/Soren
Sorry for not responding not earlier.

I'd use a treeview to solve your problem. It supports many levels and the database design will be very simple. Read this.

The table i describe is similair to your child table. You don't need more tables. You can point it to itself to create an unlimited number of levels.

HTH:D
 

Users who are viewing this thread

Back
Top Bottom