Option Compare Database
Option Explicit
Const pProgClsCode = "ord"
Dim y As Integer
'
'
Sub ExpandSubTree(rsvalue As String, NodeA As Node)
'On Error GoTo ETBE_Err
Dim rsChild As Recordset, rsChild1 As Recordset, rsTempBe As Recordset, stInv As String, Summy As Variant, No As String
Dim Qty As Double, ln As Integer
Dim n As Node, N1 As Node
Dim strSql As String
Dim strCtlName As String
Set rsChild = New ADODB.Recordset
Set rsChild1 = New ADODB.Recordset
strSql = "select progcls1code,progcls1name from tblSysProgCls1 where progclscode='ord' order by seqno;"
rsChild.Open strSql, CurrentProject.Connection, adOpenStatic, adLockReadOnly
If rsChild.RecordCount = 0 Then
Exit Sub
Else
'ln = dlen(rsChild.RecordCount)
rsChild.MoveFirst
While Not rsChild.EOF
Set n = Trv.Nodes.Add(NodeA.Index, tvwChild, "C" & rsChild("progcls1code").Value, rsChild("progcls1name").Value, 1)
n.Expanded = True 'True
If rsChild1.State = 1 Then rsChild1.Close
strSql = "select progcls2code,progcls2name from tblSysProgCls2 where progcls1code='" & rsChild("progcls1code") & "' order by seqno;"
rsChild1.Open strSql, CurrentProject.Connection, adOpenStatic, adLockReadOnly
While Not rsChild1.EOF
Set N1 = Trv.Nodes.Add(n.Index, tvwChild, "S" & rsChild1("progcls2code").Value, rsChild1("progcls2name").Value, 2)
N1.Expanded = True 'True
rsChild1.MoveNext
Wend
'ExpandSubTree rsChild("part_id").Value, N
rsChild.MoveNext
Wend
End If
Exit Sub
ETBE_Err:
' mis_Alert "Error In Explode2TempBomExtendNew......" & Error$
Exit Sub
End Sub