View PDF in Access Form

redbaron06

New Member
Joined
Aug 6, 2010
Messages
44
Hi all - I thumbed through the previous posts and was hoping to find more on the subject of displaying actual pdf documents in Access, without have them inserted as OLE obejects. I was wondering has anyone done anything simlar?

I have a database that includes hyperlinks to file paths. It would be nice if users could toggle the form with their criteria and have the pdf's located at these file paths (there could be more than one) displayed in the form.

Any help/insight is appreciated.

Cheers
-Terry
 

Excel Facts

Show numbers in thousands?
Use a custom number format of #,##0,K. Each comma after the final 0 will divide the displayed number by another thousand
You can put in hyperlinks, but I think a separate browser application window will pop up if you click it. Also, if you really want to try this, go into the form's VBA module, pull down Tools/References, and look down the list for entries that begin with "Acrobat", "Adobe" and "PDF". For specifics on all these, try Adobe's forums from www.adobe.com
 
Upvote 0
Thanks jasmith4, I went in and enabled them.

I have been trying, with no success, to generate some VB code (for MSA 2007) to get the pdf to display/be previewed using activex control (without have the user to click the hyperlinks, which I already have or a command button - which will most likely be grayed out when the user selects toggle filter). Once the form filter is activated, I am unable to get the activex box to even display with the pdf icon default.
 
Upvote 0
Code:
Option Compare Database
Private Sub AcroPDF5_Updated(Code As Integer)
Dim pdfImage As PdfLib.Pdf, strPath As String
Dim strRecord As String
Set pdfImage = Me.Pdf2.Object
strRecord = PCCD_Database.Fields("File_Path")
strPath = strRecord & Me.txtPDFName
pdfImage.LoadFile strPath
End Sub

What I have so far, I am use to VBA in Excel. Thanks for any help.
 
Upvote 0
Also attempted this to try to open the pdf up in a browser window using Activex in the form, but go a "object doesn't support this object or method" warning:

Code:
Private Sub Form_Current()
    
    If Len([File_Path]) > 0 Then
            Me!File_Path.Navigate2 [URL="http://www.mrexcel.com/forum/="]URL:=[/URL][File_Path]
        Else
            wbbWebsite.Navigate [URL="http://www.google.com/"]URL:="http://www.google.com/[/URL]"

    End If
End Sub

With the File_Path field containing different hyperlinks to U:/different_file_numbers.pdf. Any thoughts?

Thanks,
Terry
 
Upvote 0

Forum statistics

Threads
1,224,586
Messages
6,179,723
Members
452,939
Latest member
WCrawford

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top