Full Version: Opening External File (With Acrobat) based on Access Record ID
UtterAccess Forums > Microsoft® Access > Access Automation
I have a large number of images which I open with Adobe Acrobat. Each image has the name of a 'Record ID' in my database. I want to click a button in the form to start Acrobat and open a specific image. I can start Acrobat easy enough, but how can I open the image that corresponds to my current 'Record ID'?
Anyone know?
Hi, and welcome to UA!
There are two easy ways to do this.
The first is to use the command : application.followhyperlink path
where path is the full pathname to the file. To use your recordID, you would start with something like this :
dim sPath as string
spath = "c:\myFolder\WhereverThosePDFsAre\"
application.followhyperlink spath & me.txtRecordID & ".pdf"
provided that they match exactly, your pdf file will load.
The second method can be found here . It is a little more complicated, but if you are getting warning messages when you're trying to use the 'followhyperlink' method, this one is the way to go.
Hope this helps,
This is a "lo-fi" version of UA. To view the full version with more information, formatting and images, please click here.