williamlove
Registered User.
- Local time
- Yesterday, 16:56
- Joined
- Feb 9, 2006
- Messages
- 37
My app was done in Access 2000 and the file is still in that format but the problem I am about to describe appeared when I started using Access 2007. I get the same behavior when I rebuild enough of the app in a native 2007 file to test.
I have two list boxes. On the left is one that I populate with strings with the names of all the subfolders in a main folder specified in a text box. On the right is one that I populate with all the files in the subfolder specified by the selection in the list box on the right.
My problem occurs intermittently when the number of subfolders is large. If I open the form and specify a main folder containing few subfolders it takes an instant to populate. It takes about 2.5 seconds when I chose a main folder with over 600 subfolders. When I simply go back and forth and chose different main folders to populate the list box on the left—without selecting anything in either list box—this behavior stays the same, meaning the left list box is rapidly populated when the folder contains few subfolders and takes about 2.5 sec when there is a large number of subfolders.
But if I click on one of the subfolder names in the left list box—thus causing the right list box to get populated with the file names in that subfolder—things change. The next time I chose a main folder in the text box and cause the left list box to get populated with its subfolders, if the main folder is small there is no problem. But if that main folder is the large on with over 600 subfolders, the routine that populates the left list box—specifically the loop below just bogs down and takes minutes to finish.
lstFolders.RowSource = vbNullString
For Each folder In Subfolders
FolderList.AddItem (folder.Name)
Next
This does not happen if I close the form and reopen it.
I have two list boxes. On the left is one that I populate with strings with the names of all the subfolders in a main folder specified in a text box. On the right is one that I populate with all the files in the subfolder specified by the selection in the list box on the right.
My problem occurs intermittently when the number of subfolders is large. If I open the form and specify a main folder containing few subfolders it takes an instant to populate. It takes about 2.5 seconds when I chose a main folder with over 600 subfolders. When I simply go back and forth and chose different main folders to populate the list box on the left—without selecting anything in either list box—this behavior stays the same, meaning the left list box is rapidly populated when the folder contains few subfolders and takes about 2.5 sec when there is a large number of subfolders.
But if I click on one of the subfolder names in the left list box—thus causing the right list box to get populated with the file names in that subfolder—things change. The next time I chose a main folder in the text box and cause the left list box to get populated with its subfolders, if the main folder is small there is no problem. But if that main folder is the large on with over 600 subfolders, the routine that populates the left list box—specifically the loop below just bogs down and takes minutes to finish.
lstFolders.RowSource = vbNullString
For Each folder In Subfolders
FolderList.AddItem (folder.Name)
Next
This does not happen if I close the form and reopen it.