This short subroutine is intended to load a TreeView control with the directory structure and filenames on a drive. It seems to work very well when pointed toward a floppy (no matter how complex the directory structure) but chokes on a hard drive and shows only the files and folders directly off of the root.<br> My error is probably obvious to most but, after playing with this scrap of code for two days, I simply can't see it. If anybody can spot the error, I would be grateful for some guidance.<br><br>Dim nodX As Node<br>On Error Resume Next<br>Driv$ = "A:\"<br>fSpec = vbNormal Or vbReadOnly Or vbHidden Or vbSystem Or vbDirectory<br>Set nodX = TreeView1.Nodes.Add(, , "Root", Driv$)<br>Folder = 1<br>Do<br> If Folder = 1 Then <br> TreeEntry$ = Driv$<br> Else 'there will be an extra "\", so remove it<br> Fp$ = TreeView1.Nodes.Item(Folder).FullPath<br> TreeEntry$ = Driv$ + Right$(Fp$, Len(Fp$) - 4)<br> End If<br> If Right$(TreeEntry$, 1) = "\" Then<br> SrchName$ = Dir(TreeEntry$ & "*.*", fSpec)<br> Do While SrchName$ <> ""<br> If SrchName$ <> "." And SrchName$ <> ".." Then<br> Son$ = TreeView1.Nodes.Item(Folder).Key + SrchName$<br> ShowName$ = SrchName$<br> If (GetAttr(TreeEntry$ & SrchName$) And vbDirectory) = vbDirectory Then ShowName$ = ShowName$ + "\"<br> If Err <> 53 Then <br> 'no file not found error, so add a child to the tree<br> Set nodX = TreeView1.Nodes.Add(TreeView1.Nodes.Item(Folder).Key, tvwChild, Son$, ShowName$)<br> End If<br> End If<br> SrchName$ = Dir<br> Loop<br> nodX.EnsureVisible<br> End If<br> For Chk = Folder + 1 To TreeView1.Nodes.Count 'locate the next folder entry<br> If Right$(TreeView1.Nodes.Item(Chk).FullPath, 1) = "\" Then<br> Folder = Chk<br> Exit For<br> End If<br> Next<br> If Chk > Folder Then Exit Do 'no more folder entries to search<br>Loop<br> <p> <br><a href=mailto: > </a><br><a href= plain black box</a><br>