Jeremy Campbell
asked on
How to select top node of treeview in MS Access using VBA?
How can I select the top node of a treeview on load and after expand all?
Here are the two codes I have where I want this to happen:
Thanks for the help!
Here are the two codes I have where I want this to happen:
Private Sub Form_Load()
Call LoadTreeView
Dim nodThis As MSComctlLib.Node
For Each nodThis In Me.treeReqs.Nodes
nodThis.Expanded = True
Next nodThis
nodThis.Selected = True
Me.treeReqs.SetFocus
Me.JobNum = GBL_JobNum
Me.txtJobNum = GBL_JobNum
Me.txtAssemblySeq = 0
End Sub
Private Sub cmdOpStatus_Click()
Me.Application.Echo False
If Me.cmdOpStatus.Caption = "Show Complete" Then
Me.cmdOpStatus.Caption = "Hide Complete"
Else
Me.cmdOpStatus.Caption = "Show Complete"
End If
Call LoadTreeView
Dim nodThis As MSComctlLib.Node
For Each nodThis In Me.treeReqs.Nodes
nodThis.Expanded = True
Next nodThis
Me.treeReqs.SetFocus
Me.Application.Echo True
End Sub
Thanks for the help!
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER