View Single Post
  #1 (permalink)  
Old April 19th, 2009, 11:54 AM
RodM RodM is offline
Authorized User
Points: 71, Level: 1
Points: 71, Level: 1 Points: 71, Level: 1 Points: 71, Level: 1
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
Join Date: Jan 2009
Posts: 14
Thanks: 4
Thanked 0 Times in 0 Posts
Default Run PDF Reader and PDF file with Cmd Button

I created a database which contains the names of scanned magazine articles saved as PDF files. I give each PDF a descriptive name which I store in the Subject field. I placed a text box on my form to display the Subject text which is named txtSubject. What I want to do is place a command button on the form that when clicked will run my PDF reader (FoxitReader) and open the PDF whose name is stored in txtSubject for the currently displayed record. I am doing this now using a separate text box set as a hyperlink, but this requires typing in the entire path to the PDF which I would rather not do. I have used the Shell function to open the PDF reader program by itself, but I can't figure out how to write the VBA code that would use the text string in txtSubject to open the specific PDF for the current record. Can this be done? I am a VBA novice. Any help would be greatly appreciated.