Opening a file

Neerja

Registered User.
Local time
Today, 10:51
Joined
May 22, 2006
Messages
11
Hello all,

I am trying to open a file from my application.

My table has member record and a location of the relevant member details file in a text field. Now I want that the user clicks on the command button and is able to view the file.

The problem is that the file can be anything thing, xls, doc, tif, pdf , or any other type.
I tried using the shell function and works fine with notepad.exe. How do I make it open any file with the relevant software.

Any suggestions please??

Thanks in advance..

Neer
 
Searching the forum is a great way to discover and learn the answers to your Access programming questions.

Check out my Browse [Find a directory or file] sample on how to open a file using the ShellExecute method.
 
Hi Ghudson

I copied fScanDirSelectFileFromTable, tFiles and the dOpenFile modules. Your DB seems to work with just those things. However when I copy them into mine I get "13 - type mismatch" error.

Any clues

Thanks
 
re:

Hi,
you can just use the followhyperlink method e.g.:

Application.FollowHyperlink Me.YourControl

Where YourControl is the bound control to your table field holding the full string path to the external file.
HTH
Good luck
 
Sorry, just realised how little detail I put into the post lol.


When I open the form and it's ment to fetch a list of files in a directory it says "13 - type mismatch error". This only happens after I had copied it over to my DB. All the names are still the same.

I have only copy and pasted everything to my DB, no otehr changes have been made and it works fine in the original.

Am I missing reference in the code that needs to change?
 

Users who are viewing this thread

Back
Top Bottom