SOLVED

No help from Microsoft

Brass Contributor

I have spent over 1 week posting my question to various Microsoft forums. I have tried the on-line support  at https://support.microsoft.com/home/contact. I cannot get a call back or ANY HELP with my issue. I have tried googling parts of the issue but the language is so arcane that I cannot understand it. The examples are so unusual that I cannot adapt them to my problem.  I am at a loss as to what to do next except to look for a non-Microsoft database program. 

All I want is to display a PDF from an Access form. PLEASE HELP!!!! I AM AT MY WITS END!!!! PLEASE RESPOND!!!! I have tried ActiveX controls, FollowHyperlink, and other attempts. PLEASE PLEASE HELP!!!!!!!!!!!! My phone number is 775-887-1294.

15 Replies
Maxine,
I'm sorry you're having such a hard time with this.
Which forums have you posted to? Please provide links to your question.
Here are the three methods I have tried for this problem:
1. I have a parent form named “InvoicesForm” with a subform “AttachPDFForm.” There is a third form, “ViewPDFForm,” that has an ActiveX control named "ActiveXCtl2." It is an Adobe PDF Reader control. However, I cannot get it to display the PDF. It always errors on the last line "Forms!ViewPDFForm!ActiveXCtl2.source=filepath." I have checked and the variable "filepath" is the correct value. The PDF is fine. The error message is "RunTime Error 438; Object doesn't support this property or method." The code below is on a command button on the “AttachPDFForm” subform; the field "PDFName" is also on this form. PLEASE HELP!
Dim filepath As String
DoCmd.OpenForm "ViewPDFForm"
filepath = "E:\" & Me.PDFName
Forms!ViewPDFForm!ActiveXCtl2.Source = filepath

2. For the same set of forms as above the "ActiveXCtl2" is a Web Browser control. However, I cannot get it to display the PDF. It always errors on the last line "Forms!ViewPDFForm!ActiveXCtl2.object.navigate filepath." I have checked and the variable "filepath" is the correct value. The PDF is fine. The error message is "Cannot find; Make sure the path or internet address is correct." The code below is on a command button on the “AttachPDFForm” subform; the field "PDFName" is also on this form. PLEASE HELP!
Dim filepath As String
DoCmd.OpenForm "ViewPDFForm"
filepath = "E:\" & Me.PDFName
Forms!ViewPDFForm!ActiveXCtl2.object.navigate filepath

3. Have this code on a command button on a form, “AttachPDFForm” which is a subform of “InvoicesForm.” The field PDFName is also on the form. The filepath comes up OK. However, the line "Application.followhyperlink filepath,1,0" gives an error: RunTime Error 490; Cannot open the specified file." PLEASE HELP!!!!
Dim filepath As String
filepath = "E:\" & Me.PDFName
Application.FollowHyperlink filepath, 1, 0

I have not gotten any support from MS until now. I sincerely hope you can help me.
Thank you in advance.
Application.FollowHyperlink works fine for most users. Try this:
1. Locate a PDF on your computer, using Windows Explorer.
2. Simultaneously open the Run box (WindowKey+R), clear out the Open textbox, and drag and drop the file to it. Run it.
Does the PDF open in some PDF Viewer software?
Yes, it opens in Adobe Acrobat Pro 64 bit.
OK, good. Now do this:
1. Open Access and create a new blank database.
2. Open that db, and Alt+11 to open the VBA editor.
3. Ctrl+G to go to the Immediate window.
4. Type in:
Application.FollowHyperlink
and paste the path of the PDF from the previous test.
Hit Enter.
Does the PDF open in some PDF Viewer software?
Yes it opens in Adobe Acrobat Pro 64 bit, as before.
OK, great. You now have proof that this technique works for you. Incorporate it in your main app, and keep things as simple as possible.
Do you mean that I should do a Sendkeys to open the Run dialog and paste the path?

No. I meant you should use Application.FollowHyperlink in your app, perhaps in a button click event , to open a PDF you have the full path of.
The test with the Run dialog was to see if you have a correct association between .pdf file extension, and a PDF Viewer app.

I have tried it with no luck but will again.
Yes you should. Keep it VERY simple as a first approximation. No more than 5 lines of code. Share your code if it does not work.
Thank you sooooo much. It works now. I am so thankful you took the time to work with me.
Hearts & Flowers,
Maxine
I'm thrilled to hear that.
Are there any lessons learned you want to share with the community?
best response confirmed by Maxine14062 (Brass Contributor)
Solution
Yes. Come to your first!
1 best response

Accepted Solutions
best response confirmed by Maxine14062 (Brass Contributor)
Solution
Yes. Come to your first!

View solution in original post