Hi,
I trying to list the files in a folder and show the output list in a Combo Box (CB_List) using the code
The files in 'FilesinFolder' appear to be in a random order (when I list them out in the combo box).
Is there a way to order them by name/alpha order either before doing Me!CB_List.RowSource = Pack
or after it's in the combo box??
Thanks
M
I trying to list the files in a folder and show the output list in a Combo Box (CB_List) using the code
Code:
Dim fso As New FileSystemObject
Dim f As File
Dim fld As Folder
Dim FilesinFolder As Files
Dim MyPath As String
MyPath = "c:\docs"
Set fld = fso.GetFolder(MyPath)
Set FilesinFolder = fld.Files
For Each f In FilesinFolder
Pack = Pack & ";" & f.Name
Next
Me!CB_List.RowSource = Pack
The files in 'FilesinFolder' appear to be in a random order (when I list them out in the combo box).
Is there a way to order them by name/alpha order either before doing Me!CB_List.RowSource = Pack
or after it's in the combo box??
Thanks
M