K
Kro
I want to change the value in a txt box (or combo box) & then after update,
populate a tree list control based on the value. It gets hung up when the
rstCategory opens using the SQL. Here is the code:
Public Sub PopulateTree()
Dim rstCategory As New ADODB.recordset, rstComponent As New ADODB.recordset
Dim rstSubComponent As New ADODB.recordset
Dim tvwTree As Object
Dim nodX As Node
Dim I As Integer
Dim blnAllRecs As Boolean
Dim SQL As String
Set tvwTree = Me.tvwItems
'Renumber all items
RenumberItems
'Clear out all current items
tvwTree.Nodes.Clear
'Set blnAllRecs to use in query building
If Me.fmeView = 1 Then
blnAllRecs = False
Else
blnAllRecs = True
End If
'Build recordset for Categories (from a pre-selected client) at top level
SQL = "SELECT Categories.catID, Categories .catName " & _
"FROM Categories" & _
"WHERE Categories.pID = " & [Forms]![frmComponents]!txtpID.Value & _
"ORDER BY Categories.catName"
rstCategory.Open SQL, CurrentProject.Connection, adOpenStatic,
adLockReadOnly
populate a tree list control based on the value. It gets hung up when the
rstCategory opens using the SQL. Here is the code:
Public Sub PopulateTree()
Dim rstCategory As New ADODB.recordset, rstComponent As New ADODB.recordset
Dim rstSubComponent As New ADODB.recordset
Dim tvwTree As Object
Dim nodX As Node
Dim I As Integer
Dim blnAllRecs As Boolean
Dim SQL As String
Set tvwTree = Me.tvwItems
'Renumber all items
RenumberItems
'Clear out all current items
tvwTree.Nodes.Clear
'Set blnAllRecs to use in query building
If Me.fmeView = 1 Then
blnAllRecs = False
Else
blnAllRecs = True
End If
'Build recordset for Categories (from a pre-selected client) at top level
SQL = "SELECT Categories.catID, Categories .catName " & _
"FROM Categories" & _
"WHERE Categories.pID = " & [Forms]![frmComponents]!txtpID.Value & _
"ORDER BY Categories.catName"
rstCategory.Open SQL, CurrentProject.Connection, adOpenStatic,
adLockReadOnly