Tree List

A

alex.kemsley

I have a Tree List on an access for, when i click on the name how do i
get it to put the ID Number into a text field

Any Help with Tree List would be great
 
R

Rob Parker

Hi Alex,

Do you mean a TreeView control, when you say "Tree List"? If so, it's not
hard, but the exact answer depends on how you've populated your treeview
control. If you've done so using the ID Number as the key for each node,
then it's as simple as this (also assuming that when you say "text field"
you mean a textbox control on your form):

Private Sub YourTreeViewControl Name_NodeClick(ByVal Node As Object)
Me.YourTextboxControlName = Node.Key
End Sub

If you don't have the ID Number as the key - perhaps it's the Node.Text -
then you'd use that. If it's not attached to the node at all, then you'd
need to get it via a dLookup from the Node.Key or Node.Text or ... You may
need to requery the form to get the ID Number to appear.

Note also that the NodeClick event of the treeview control is not listed in
the Event tab of the property dialog box; you have to access it via the
combo-boxes in the Visual Basic editor - select the treeview control in the
left-hand combo, then the NodeClick event in the right-hand combo.

If you want some examples of how to use/program a treeview control, the best
one that I've found is Alex Dybenko's at
http://www.pointltd.com/Downloads/Details.asp?dlID=36

HTH,

Rob
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Top