Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / ActiveX Controls / April 2004

Tip: Looking for answers? Try searching our database.

TreeView - Select node with cursor keys?

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Paul Johnson - 08 Apr 2004 06:59 GMT
I am building a form with a Treeview control whose nodes represent folders
for reports.  Navigating in the tree updates the listbox lstReports as the
nodes are selected by clicking the mouse.  This works fine, but I prefer to
keep my hands on the keyboard. The cursor keys and alpha keys work to move
about in the Treeview control, but the rowsource property of my listbox
doesn't update until the user clicks with the mouse.  Is there another event
or method I can use besides _click(), to update the property as the user
navigates through the control?

This code is simple, but you can see that clicking in the treeview populates
reports in another control, and updates the enabled property of  the "Remove
Node" button, making it True if the node is childless.
---------------------------------------
Private Sub xTV_Click()

   lstReports.RowSource = _
       "SELECT ReportID, Name, ToDate " & _
       "FROM Reports " & _
       "WHERE Parent = '" & xTV.SelectedItem.Key & "' " & _
       "ORDER BY todate, Name ;"

   cmdRemoveNode.Enabled = xTV.SelectedItem.Children = 0

End Sub
---------------------------------------
Thanks in advance.

Paul Johnson
Alex Dybenko - 08 Apr 2004 07:16 GMT
Poul
you better use Node Click event

Signature

Alex Dybenko (MVP)
http://Alex.Dybenko.com
http://www.PointLtd.com

> I am building a form with a Treeview control whose nodes represent folders
> for reports.  Navigating in the tree updates the listbox lstReports as the
[quoted text clipped - 24 lines]
>
> Paul Johnson
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.