A little help

  • Thread starter Thread starter Jacob
  • Start date Start date
J

Jacob

I have a list of PDF files that I would like to associate with my access
2000 Data base. Is there a way I can open a certain file from a form inside
my access DB? For example....

form button name.... ABC which should open the ABC.PDF file.


I will have the corresponding file in a folder on a hard drive. What code
could I use to open that file with that button?
 
Jacob said:
I have a list of PDF files that I would like to associate with my access
2000 Data base. Is there a way I can open a certain file from a form inside
my access DB? For example....

form button name.... ABC which should open the ABC.PDF file.


I will have the corresponding file in a folder on a hard drive. What code
could I use to open that file with that button?


Consider this example:

Dim strFileName As String
Dim strFolder As String

strFileName = "ABC.PDF"
strFolder = "C:\Path\To\SomeFolder\"

' where strFolder is the path to the folder containing strFileName.

Application.FollowHyperlink strFolder & strFileName
 
OUTSTANDING!!! That worked perfectly. Now I am going to create a list of
those files, is there a global way to set the directory and just select the
file for the button?
 
Jacob said:
OUTSTANDING!!! That worked perfectly. Now I am going to create a list of
those files, is there a global way to set the directory and just select
the file for the button?


I don't really follow you. You can establish a standard folder, so that all
the files can be assumed to be in that folder, and then you can either
hard-code that folder or store the information in a configuration table.
But I'm not at all sure what you have in mind.
 
Back
Top