Open any file from within an Access form

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.
 
M

Mike Boozer

Try
DoCmd.RunCommand acCmdInsertObject

to open standard insert dialog box or

DoCmd.RunCommand acCmdInsertHyperlink

to insert hyperlink to file.
 
C

Chris Nebinger

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top