Forum Discussion
Maxine14062
Apr 11, 2024Brass Contributor
No help from Microsoft
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...
- Apr 12, 2024Yes. Come to your first!
Tom_van_Stiphout
Steel Contributor
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.
I'm sorry you're having such a hard time with this.
Which forums have you posted to? Please provide links to your question.
Maxine14062
Apr 11, 2024Brass Contributor
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.
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.
- Tom_van_StiphoutApr 11, 2024Steel ContributorApplication.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?- Maxine14062Apr 11, 2024Brass ContributorYes, it opens in Adobe Acrobat Pro 64 bit.
- Tom_van_StiphoutApr 11, 2024Steel ContributorOK, 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?