ClaraBarton
Registered User.
- Local time
 - Yesterday, 17:23
 
- Joined
 - Oct 14, 2019
 
- Messages
 - 754
 
Me again...
This is the code that was actually calling the Object Variable Error when the form opens that I was complaining about yesterday. I went back to your treeview and noted that this code is under AfterUpdate on frmE2E. I marked it to step through and couldn't ever get it to run so I changed it to Current and received the same error.
The error comes at Me.TVW.TreeView.Nodes(strKey).Selected = True. The version I'm testing is MajP TreeviewDemo v19_Full_CutPaste.accdb. I don't have to have this event but I like that it ties the treeview to the detail subform when the record changes.
I noted that each line throws the same error.
	
	
	
		
 This is the code that was actually calling the Object Variable Error when the form opens that I was complaining about yesterday. I went back to your treeview and noted that this code is under AfterUpdate on frmE2E. I marked it to step through and couldn't ever get it to run so I changed it to Current and received the same error.
The error comes at Me.TVW.TreeView.Nodes(strKey).Selected = True. The version I'm testing is MajP TreeviewDemo v19_Full_CutPaste.accdb. I don't have to have this event but I like that it ties the treeview to the detail subform when the record changes.
I noted that each line throws the same error.
		Code:
	
	
	Private Sub cmboNode_Current()
  Dim strKey
  On Error GoTo errlbl
  If Not IsNull(Me.cmboNode) Then
    strKey = Me.cmboNode.Value
     Me.TVW.TreeView.Nodes(strKey).Selected = True
     Me.TVW.TreeView.SelectedItem.EnsureVisible
     Me.TVW.TreeView.DropHighlight = Me.TVW.SelectedNode
     Me.cmboNode = Null
  End If
  Exit Sub
errlbl:
  If Err.Number = 35601 Then
    MsgBox "The following key: " & strKey & " is not found or not Expanded yet. You can select Expand Tree."
  Else
    MsgBox Err.Number & " " & Err.Description & " In CmboNode Afterupdate."
  End If
 
End Sub