I have searched all the answers I could find and none seemed to work me (they either all produced errors or produced empty listboxes)....so clearly I have missed something.
I am using Access 2007
I want to be able to display ALL the files and sub-folders of a specific folder with a listbox (or combobox...whichever is best to use). If sub-folders are displayed, the user should be able to click into the subfolder.
I located coding which starts the listbox with all found directories on the network but I seem unable to modify it to specify a starting point.
Private Sub sFillRoot()
Dim strAllDrives As String
Dim strTmp As String, strOut As String
Dim loDir As clsDir
Set loDir = New clsDir
strAllDrives = fGetDrives()
strOut = vbNullString
mboolRoot = True
strTmp = Mid$(strAllDrives, 1, InStr(strAllDrives, vbNullChar) - 1)
strAllDrives = Mid$(strAllDrives, InStr(strAllDrives, vbNullChar) + 1)
strOut = strOut & strTmp & ";"
Loop While strAllDrives <> ""
strOut = Left$(strOut, Len(strOut) - 1)
' populate the ListBox
.RowSourceType = "Value List"
.RowSource = strOut
' this is a back button allowing the user to backup through the folder
Me!cmdNavUp.Enabled = False
Set loDir = Nothing
mstPath = vbNullString