thanks to the help of a member of this great forum
(https://www.accessforums.net/program...ray-18818.html)
I had this more than welcomed gift: two user defind function to get files name present in a given dir;
'---------------------------------------------------------------------------------------------------------------
Public Function GetFiles(colDirList As Collection, ByVal FilePath As String, FileName As String) As Boolean
Dim strTemp As String
Dim colFolders As New Collection
FilePath = TrailingSlash(FilePath)
'returns the file name
strTemp = dir(FilePath & FileName)
Do While strTemp <> vbNullString
' adds the items to the collection colDirList
' two options available here
colDirList.Add FilePath & strTemp 'path and file name
colDirList.Add strTemp 'just the file name
strTemp = dir
Loop
End Function
Public Function TrailingSlash(FilePath As Variant) As String
If Len(FilePath) > 0& Then
If Right(FilePath, 1&) = "\" Then
TrailingSlash = FilePath
Else
TrailingSlash = FilePath & "\"
End If
End If
End Function
'---------------------------------------------------------------------------------------------------------------
now, I would like to generalise the function GetFiles in order to have two optional features: i.e. listing files with or without the indication of the path (at choice);
to accomplish that I think it has something to do with the declaration Enum.
In other words something like:
Public Enum....
Option1 ...
Option2...
End Enum
I've been "googled" the web, searched this forum, and read the on-line help but I could not find a proper solution (unless I'm not pointing to the wrong direction)
any help for this?