It rather depends on some more detail about your requirements. Are you trying to match files to existing
records ? or just add a new record for each file found ? something else ?
Here's some code from our 'batchload' sample that you may be able to use as a starting point:
strCaption = "Select folder to load images from"
strFolderName = BrowseFolder(strCaption)
If Not IsEmpty(strFolderName) Then
strSearchSpec = strFolderName + "\" + "*.jpg"
strFile = Dir(strSearchSpec, vbNormal)
While (Not StrComp(strFile, ""))
If Len(strFile) > 1 Then
strFullPath = strFolderName + "\" + strFile
DoCmd.GoToRecord , , acNewRec
ActiveXCtl0.ImageLoadFile (strFullPath)
End If
strFile = Dir
Wend
End If
Notes:
* BrowseFolder uses the sample code by Terry Kreft.
* Replace the 'ActiveXCtl0.ImageLoadFile(strFullPath)' with your own code to store the path, copy the image
or whatever.
* The sample itself is available for download from our website (see sig below), but note that as-is it
uses our own image control, resamples the images and stores them in the table, rather than storing the
path.