Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Folder access (Access 2003)

6 views
Skip to first unread message

H. Martins

unread,
Mar 8, 2012, 5:29:49 AM3/8/12
to
Hi,

I'm implementing this method so that people can access files and open
them according to folder location previously stored in a configuration
table.

====================================

Private Sub btnPautas_Click()

On Error GoTo btnPautas_Click_Error

Dim strFolder As String
strFolder = "\\server-1\exam\calcs\2009" 'as example

Dim strFilter As String
Dim strInputFileName As String

strFilter = ahtAddFilterItem(strFilter, "Excel Files (*.XLS)",
"*.XLS")
strInputFileName = ahtCommonFileOpenSave(InitialDir:=strFolder, _
Filter:=strFilter, OpenFile:=True, _
DialogTitle:="Please select an input file...", _
Flags:=ahtOFN_HIDEREADONLY)

Application.FollowHyperlink strInputFileName

On Error GoTo 0
Exit Sub

btnPautas_Click_Error:

MsgBox "Error " & Err.Number & " (" & Err.Description & ") in
procedure btnPautas_Click of VBA Document Form_TurmasConstituicaoDe"

End Sub

==========================

It works OK but I have a problem: people can 'travel' above the '2009'
folder and from them to other child folders.

Is there a way to say 'clip' the access to parent folders? If not, Is
there some other method to get the required result?

Thanks
H. Martins

Stefan

unread,
Mar 8, 2012, 11:32:17 AM3/8/12
to
Hi,
you can use a normal windows file dialog!
I use the filedialog from Karsten Pries (http://www.kpries.de/)
or try the example from Stephan Lebans (http://www.lebans.com/callbackbrowser.htm).

regards
Stefan Schulte-Kellinghaus

0 new messages