Open any file from within an Access form

  • Thread starter Thread starter Joe Best
  • Start date Start date
J

Joe Best

I would like to have a command button on a form which opens the standard
common dialog box which will then allow a user to open a file.

Any ideas how to do this please?

Many thanks,

Joe.
 
Try
DoCmd.RunCommand acCmdInsertObject

to open standard insert dialog box or

DoCmd.RunCommand acCmdInsertHyperlink

to insert hyperlink to file.
 
Use http://www.mvps.org/access/api/api0001.htm to select a
file.

Then FollowHyperlink on the file you selected. Add in
that code, then use this example.

Dim strFilter As String
Dim lngFlags As Long
Dim strFile As String
strFilter = ahtAddFilterItem(strFilter, "All Files
(*.*)", "*.*")
strFile = ahtCommonFileOpenSave(InitialDir:="C:\",
Filter:=strFilter, FilterIndex:=3, Flags:=lngFlags,
DialogTitle:="Open File")
FollowHyperlink strFile


Chris Nebinger
 
Back
Top