subsubsubsubject treestyle.

ice-9

Registered User.
Local time
Today, 14:29
Joined
May 21, 2004
Messages
88
Hi,
i want to create a meetingstyle form
the form must have a tree with the posibility to make subjects. In those subjects you can make sub subjects and so on.

see example.

How do i construct the relations?
see picture:
 

Attachments

  • subjects.JPG
    subjects.JPG
    8.1 KB · Views: 142
Pat Hartman said:
As long as each item has only a single parent, you would use a self referencing table.

tblSubject
SubjectID (autonumber primary key)
SubjectName
ParentSubjectID (foreign key to tblSubject)
etc.

when i export it as a raport. The numbering is very important. It goes to customers. The subject will be numbered:

Meeting: 1
1 subject
1.1
1.2
1.2.1
1.2.2
1.3

When i use recurency, you have to generate the numbers. Aint this risky? Aint it smarter to record the numbering in a table. For example a text style key.
 
don't expect to sort
meaning you can't sort? (sorry sometimes english is a bit hard to understand)

Instead I would create a numeric field that holds the LOWEST level in each record. So the numbers would need to be concatenated in the report to look the way you want.
i thought of that.
you mean:

subjectnr, meetingnr, subjecttitle, location ( LOWEST level )
1---------1----------subject 1-----1
2---------1----------subject 2-----1
3---------1----------subject 3.1---2
4---------1----------subject 3.2---2

showing:
meeting 1
1 subject
2 subject 2
3.1 subject 3
------------> here you will get trouble!
4.1 subject 3.2
it shows 4.1, but needs to show 3.2.

so you have to generate the numbers with counts and things?
 
Pat Hartman said:
No, I ment that you can't sort the string the way you want since it will be sorted as a string rather than as a number.

1 subject
1.1
1.11
1.12
1.13
1.14
1.2
1.2.1
1.2.2
1.3
1.4
1.5
1.6
1.7
1.8
1.9

Notice how 1.11 - 1.14 appear after 1.1 and before 1.2. That is because this is a string and strings are sorted column by column, left to right.

damn, u are right! didnt think of that.

So what I was saying is each record needs to store the rightmost node of the string.
The record for 1.12.22 would only store the 22 (as a number) and not the 1.12
The record for 1.12 would only store the 12 (as a number) and not the 1
The record for 1 would store the 1. And these numeric values are what you would need to sort on to get your tree to come out in the correct order

still a bit confused here. You still use the textstyle key, but you also create a field that is nummiric, that contains the last digit of each record?
 
ok, i think i know what your saying.

but when the first diget goes above 10, the same problem occures!

minuteID MinuteCodeMinuteLastDigit
1---- 1,1---- 1
3---- 1,12---- 12
4---- 1,13---- 13
5---- 1,14---- 14
2---- 1,2---- 2
9---- 12,1---- 1
10---- 12,2---- 2
6---- 12,3---- 1

8---- 2,12---- 12
7---- 2,2---- 2
 
aint this a solution? using a query

Expr1: Int([MinuteCode])
the rest sorts with the last digit style!
 
Pat Hartman said:
If you want a numeric sort, store the data as a number. Don't store it as text. Your original post indicated an unknown depth to the tree which is why I suggested a self referencing table.

self reflecting as in an employeetable. Where an employee has a boss.
im doubing it would work. you have for example:
58----0
59----58
60----58
61----60

this shoud show
1
1.1
1.2
1.2.1
 

Users who are viewing this thread

Back
Top Bottom