Something you must do (plus I need to remember to give Arvin an update to
that page, as this is a fairly common issue!)
When you use Multi-Select, the string that's returned contains the name of
the folder, followed by a Null character (Chr(0)), followed by the name of
the first file, followed by a Null character, followed by the name of the
second file, followed by a Null character, followed by the name of the next
file and so on until all file names have been returned. There will actually
be two Null characters at the end of the string.
Unfortunately, the TrimNull function in that sample page is set up to trim
at the first Null, so all it's going to return is the folder.
Change that function so something like:
Private Function TrimNull(ByVal strItem As String) As String
Dim intPos As Integer
intPos = InStr(strItem, vbNullChar & vbNullChar)
If intPos > 0 Then
TrimNull = Left(strItem, intPos - 1)
Else
intPos = InStr(strItem, vbNullChar & vbNullChar)
If intPos > 0 Then
TrimNull = Left(strItem, intPos - 1)
Else
TrimNull = strItem
End If
End If
End Function
Then, you'll need to add logic to parse what's returned as the string.
Assuming you're using Access 2000 or newer, the simplest is something like:
Dim intLoop As Integer
Dim strFiles As String
Dim varFiles As Variant
strFiles = ahtCommonFileOpenSave(....)
If Len(strFiles) > 0 Then
varFiles = Split(strItem, Chr(0))
For intLoop = 1 To UBound(varFiles)
Debug.Print "File " & intLoop & ": " & _
varFiles(0) & "\" & varFiles(intLoop)
Next intLoop
End If