Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Open external folders from within an Access DB

Status
Not open for further replies.

ruzi55

Programmer
Jul 6, 2004
8
GB
I have got a database which has two tables one holding member name and address and the answers to 8 survey questions and one holding Farming Activity - dead simple database...................

The requirement is to have a number of external folders, an article folder where the scanned articles will be held as .pdf files, also there will be a number of picture folders (eg one for beef pics, one for sheep pics etc) I am expecting at the moment that these will be .pdf files.

Currently within the database is an option to view data from the survery results table (either in form or report view) depending on criteria selected.
Requirement is to be able to "browse" the folders/files in the article and picture folders from with in Access.

I have spent a couple of days trying to ascertain whether this is possible, the best I have come up with is the possibility of a piece of code that will open a specified folder, this will allow the user to scroll through the files and select as appropriate........

Below is a piece of code that "we" used in the members expenses to check whether or not the import folders contained any files..............

'check error log file
Set fs = Application.FileSearch
With fs
.LookIn = "\\NFUR12AP01\MXDATA$\STDDEV\ERROR"
.FileName = "MXSTDIMP*.txt*"
If .Execute > 0 Then
MsgBox "There were " & .FoundFiles.Count & _
" file(s) found in the ERROR directory."
Exit Sub
Else
MsgBox "There were no files found - Release data for import"
Dim UpdateAfterRelease As String

UpdateAfterRelease = "mcr_MXUpdateProcesses.OnEmptyErrorLog"
DoCmd.RunMacro UpdateAfterRelease

End If
End With

Question
Would it be possible to adapt the code to actually point to the specific folder and open it for viewing (allowing selection of required files) eg instead of .LookIn is there a function like GetFolder, OpenFolder or something similar - I have tried the following

'GET FOLDER
Dim fs As Application.FolderSearch
Set fs = Application.FolderSearch
With fs
.getfolder ("V:\CSShared\Access\PACCS (PA Campaign Contact System)\Articles")
End With

and got an error message




Many thanks
Ruzi

 
Have a look at
thread702-936818

Hope this helps
Hymn
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top