aclayborne
Programmer
I'm using this code to populate a treeview control it give me a 35603 runtime error "invalid key". PCID is a char type. What is wrong with the code.<br><br><br>If rs.RecordCount > 0 Then<br> rs.MoveFirst<br> Do Until rs.EOF<br> If Trim(rs.Fields("PCID") <> prevPCID Then<br> Set oNodex = TreeView1.Nodes.Add(, , Trim(rs.Fields("PCID"), Trim(rs.Fields("PCID"))<br> prevPCID = Trim(rs.Fields("PCID")<br> End If<br> If Trim(rs.Fields("Description") <> prevDesc Then<br> Set oNodex = TreeView1.Nodes.Add(Trim(rs.Fields ("PCID"), tvwChild, Trim(rs.Fields("Description"), Trim(rs.Fields("Description"))<br> prevDesc = Trim(rs.Fields("Description")<br> End If<br> rs.MoveNext<br> Loop<br>End If