How can I insert a field from a DB that is empty in to a tree as a child. I know the field is empty I just can't get it to load. I tried this
but it comes back and tells me "element not found" and highlights the code above but points to the bold lineCode:If IsNull(rsRoutines.Fields("Description")) Then tvwMain.Nodes.Add "Routine" & rsRoutines("ParentID"), _ tvwChild, "Routine" & rsFiltered("counter"), _ rsFiltered("Routine"), "closed", "open"
this is the full code
the first if..then works fine it is the second one that doesn't. What am I doing wrong?Code:Set rsRoutines = dbName.OpenRecordset("SELECT * FROM Routine " _ & "ORDER BY ParentID, Routine") ', dbOpenSnapshot) Dim SelectString As String SelectString = "Select * from Routine where [Counter]= " + Label2 Set rsFiltered = dbName.OpenRecordset(SelectString) Do While Not rsFiltered.EOF ?'Add routine nodes If rsRoutines.Fields("ParentID") > "0" Then tvwMain.Nodes.Add "Routine" & rsRoutines("ParentID"), _ tvwChild, "Routine" & rsFiltered("counter"), _ rsFiltered("Routine"), "code", "codered" If IsNull(rsRoutines.Fields("Description")) Then tvwMain.Nodes.Add "Routine" & rsRoutines("ParentID"), _ tvwChild, "Routine" & rsFiltered("counter"), _ rsFiltered("Routine"), "closed", "open" End If End If rsFiltered.MoveNext Loop rsRoutines.MoveNext Loop
TIA




