If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
Hierarchycal TreeView DB
Hello!
I have created a very simple hierarchycal list based on the Adjacency-List model (see DB attached). I have also created a form with TreeView to browse the hierarchy. In the form frmProjectos, from the DB attached, I would like that, when the user clicks on any Project, the form right shows this Project record. How can I do this? Thank you! You can download the sample DB file from: http://www.utteraccess.com/forums/uadl.php?Zn=1916276 |
#2
|
|||
|
|||
Hierarchycal TreeView DB
On Tue, 22 Dec 2009 12:27:33 GMT, "vmcduarte" u56987@uwe wrote:
You need a little bit different approach. First off it is highly convenient if you use the Primary Key as the Node.Key value. Prefixing "a" is not really helpful. Then you can write: Private Sub xTree_NodeClick(ByVal Node As Object) Debug.Print "You clicked on node " & Node.Key Dim lngID As Long lngID = CLng(Mid(Node.Key, 2)) 'Strip trailing char. With Me.Parent.RecordsetClone .FindFirst "IDProjecto=" & lngID If Not .NoMatch Then Me.Parent.Bookmark = .Bookmark End If End With End Sub Btw, your code needs more work. For example you should close all recordset objects when you are done with them, and set to Nothing. -Tom. Microsoft Access MVP Hello! I have created a very simple hierarchycal list based on the Adjacency-List model (see DB attached). I have also created a form with TreeView to browse the hierarchy. In the form frmProjectos, from the DB attached, I would like that, when the user clicks on any Project, the form right shows this Project record. How can I do this? Thank you! You can download the sample DB file from: http://www.utteraccess.com/forums/uadl.php?Zn=1916276 |
Thread Tools | |
Display Modes | |
|
|