Error message on Treeview

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
 
A

Arvin Meyer [MVP]

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

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

Top