Results 1 to 10 of 10
  1. #1
    Gold Lounger
    Join Date
    Jan 2004
    Location
    Italy
    Posts
    3,245
    Thanks
    0
    Thanked 0 Times in 0 Posts

    insert a new node subfilter in treeview (6.0)

    The project attached insert in treeview rset value from mdb.
    The really mdb is about 65.000 records.
    Now, to use another subfilter i want to add a new node child to filter the filed PROVA3.

    example:

    actual scenario:
    AREA (from table AREA_TERR) - Root
    PROVA2 (from table SPORTELLI based index in filed REGIONE) node - Root
    show all records base PROVA2

    new scenario:
    AREA (from table AREA_TERR) - Root
    PROVA2 (from table SPORTELLI based index in filed REGIONE) node1
    PROVA3 from DATI based index of PROV2 is a new node filter
    In this case the root is:
    8505
    0500
    78
    PROVA4, PPROV5,....
    PROVA4, PPROV5,....
    PROVA4, PPROV5,....
    ....
    80
    PROVA4, PPROV5,....
    PROVA4, PPROV5,....
    PROVA4, PPROV5,....
    41
    PROVA4, PPROV5,....
    PROVA4, PPROV5,....
    PROVA4, PPROV5,....
    ......
    75
    PROVA4, PPROV5,....
    PROVA4, PPROV5,....
    PROVA4, PPROV5,....
    ......
    4500
    78
    PROVA4, PPROV5,....
    PROVA4, PPROV5,....
    PROVA4, PPROV5,....
    80
    PROVA4, PPROV5,....
    PROVA4, PPROV5,....
    PROVA4, PPROV5,....
    41
    PROVA4, PPROV5,....
    PROVA4, PPROV5,....
    PROVA4, PPROV5,....
    75
    PROVA4, PPROV5,....
    PROVA4, PPROV5,....
    PROVA4, PPROV5,....
    .......
    ecc...

    hope undrstand me.

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: insert a new node subfilter in treeview (6.0)

    Which table should be used for the new level?

  3. #3
    Gold Lounger
    Join Date
    Jan 2004
    Location
    Italy
    Posts
    3,245
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: insert a new node subfilter in treeview (6.0)

    i'm sorry, is DATI

  4. #4
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: insert a new node subfilter in treeview (6.0)

    The first level uses AREA_TERR, with COD_AREA as key.
    The second level uses SPORTELLI (linked to the first level on REGIONE), with SPORT as key.
    The third level uses DATI (linked to the second level on PROVA2), with a combination of PROVA1 through PROVA8 as key.
    If I understand you correctly, you want to create a fourth level. It seems most logical if you use a fourth table for this level.
    If you want something else, please explain more clearly.

  5. #5
    Gold Lounger
    Join Date
    Jan 2004
    Location
    Italy
    Posts
    3,245
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: insert a new node subfilter in treeview (6.0)

    Hi Hans...
    Peraphs i have a very very new methoh wiht joint table...
    Test it!
    But change DESCRIZIONE in DESCRIZIONE2 in table SPORTELLI
    Tell me

  6. #6
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: insert a new node subfilter in treeview (6.0)

    I cannot test your code, I don't have VB6.

  7. #7
    Gold Lounger
    Join Date
    Jan 2004
    Location
    Italy
    Posts
    3,245
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: insert a new node subfilter in treeview (6.0)

    yes....
    Instedead to display directly the record 0500 and all arelated record i want to add i new key based PROVA3 refered from PROVA2 in DATI...
    Admit 0500 is agency 78 is a sub agency
    In this case if i ckick on 0500 expand all record from thsi agency but i want show all dispoible sub angency (for example 78 with all the recordrds...)
    if you order the table DATI fror PROVA2 and PROV3 you can see for 0500 one sbagency 41 with 1 record, sbagency 75 with 1 record, sbagency 78 with 10 records....
    Example:
    clcik on 0500 list all sub agency 41,75,78,80,B0,80, if i clck on 41 list only the record refred from 41 and 0500 (1 records)...ecc

  8. #8
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: insert a new node subfilter in treeview (6.0)

    Try this for the third loop (the one for DATI):

    ADOOpenRecordSet "Select * from DATI"
    ADO_RS.MoveFirst
    On Error Resume Next
    Do Until ADO_RS.EOF
    sKey = "L" & ADO_RS.Fields("PROVA2")
    sValue = ADO_RS.Fields("PROVA3")
    .Nodes.Add sKey, tvwChild, "M" & sValue, sValue, 1, 2
    ADO_RS.MoveNext
    Loop
    ADO_RS.Close

  9. #9
    Gold Lounger
    Join Date
    Jan 2004
    Location
    Italy
    Posts
    3,245
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: insert a new node subfilter in treeview (6.0)

    TKS... i have adjust your kode and now work fine.

    But have a prob to intrcept the correct gerarchy of treeview...
    In effect if i click the item (for example COPE - 5581816A) i want to intercept the gerarchy of root in treview to uinsert the value in textbox...
    see attached image

    Example:

    in tbox COPE insert the value of cliked item (in this case COPE - 5581816A)
    in tbox AGENZIA insert the value of cliked item (in this case 0558 - ANDRIA)
    in tbox SETTORE insert the value of cliked item (in this case 00)

    note:
    8505 - REGIONE SUD is the principal root

  10. #10
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: insert a new node subfilter in treeview (6.0)

    You can use the NodeClick event of the treeview control. The Node argument of the event procedure is the node that the user clicked on. You can inspect the Key and Text properties of the node.

    See:
    NodeClick Event
    Node Object, Nodes Collection

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •