Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Opening pdf's from within Access

Status
Not open for further replies.

SpandexBobcat

Technical User
Jul 31, 2003
332
GB
Hi folks,

I am creating a database for the British Standards that my company uses and some of these are available in a pdf format. I looked on Tek-Tips re how to link them and found a post saying that I should create a field, set it as type OLE. From there open the table in datasheet view, right click and add the file (as a link) This all works fine but it will not let me save, saying that
The OLE server isn't registered. To register it reinstall it
Now I have been to the ActiveX controls and tried unregistering it and re-registering it but nothing happens...
There is another approach that I could use and that is using the Shell command but I am not sure if this will complicate matters for me and my users. (adding new ones will be a pain, I think)

Can anyone tell me how to solve the OLE problem?

Thanks in advance,

Simon
 
Hi, not too sure what the problem is but in case you missed a step -

Create a new form
Add the activeX control for Adobe Acrobat
Recheck the references an ensure it's there.
You do need to have Acrobat or Acrobat Reader installed.

The src property is the one you need for displaying pdfs.
From a button:

Private Sub Command1_Click()

Me.Pdf0.Object.src = "c:\Pdfs\perfume atomizer.pdf"
Me.Pdf0.Requery
End Sub

You can run this from a combo or list box whose rowsource is the directory in which your pdf's reside and use the after update event to fire it. For a single pdf, type the path into the src property of the object itself without the double quotes.

To link externally, here is a sample for a combo box:

myCombo After Update()

dim Myfile,StSql as string

myfile = Dir(C:\PDFs\*.*")
StSql = myfile & ";"

Do While Not (myfile = "")

myfile = Dir

StSql = StSql & myfile & ";"

me.MyCombo.rowsource = stsql

The last bit is from memory, but it should be close.

Hope that helps.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top