From: jwebster1979 on
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
From: Arvin Meyer [MVP] on
Just a thought. Tree views are case sensitive. Check your data and make sure
that all of it conforms.
--
Arvin Meyer, MCP, MVP
http://www.datastrat.com
http://www.accessmvp.com
http://www.mvps.org/access


"jwebster1979" <jwebster1979(a)discussions.microsoft.com> wrote in message
news:90AA9903-B562-42C6-AB28-D892B10F071A(a)microsoft.com...
>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