Error message on Treeview

  • Thread starter Thread starter jwebster1979
  • Start date Start date
J

jwebster1979

I am getting an error message on my child link on my code it is error:
Runtime 35601 element not found when I try to take the form out of design
view. any help would ba appreciated! Here is my code:

Private Sub CreateSubDivisionNodes()
Dim Rst As DAO.Recordset
Set Rst = CurrentDb.TableDefs!tblsubdivision.OpenRecordset
Rst.MoveFirst
Do Until Rst.EOF
Me.xSubLineTreeView.Nodes.Add Text:=Rst!subdivisionname, _
key:="SubDiv" & CStr(Rst!SubDivision_ID)
Rst.MoveNext
Loop
Rst.Close
Set Rst = Nothing
End Sub

Private Sub CreateSubLineNodes()
Dim Rst As DAO.Recordset
Set Rst = CurrentDb.TableDefs!tblsublineitem_id.OpenRecordset
Rst.MoveFirst
Do Until Rst.EOF
Me.xSubLineTreeView.Nodes.Add Relationship:=tvwChild, _
Relative:="subdiv" & CStr(Rst!SubDivision_ID), _
Text:=Rst!sublineitemname, key:="subline=" & CStr(Rst!SubLineItem_ID)
Rst.MoveNext
Loop
Rst.Close
Set Rst = Nothing
End Sub

Private Sub Form_Open(Cancel As Integer)
CreateSubDivisionNodes
CreateSubLineNodes

End Sub
 
Just a thought. Tree views are case sensitive. Check your data and make sure
that all of it conforms.
 
Back
Top