In Access, an ActiveX control is not working

Maxine Nietz 1 Reputation point
2024-05-29T16:34:35.52+00:00

I have a form “InvoicesForm” with a subform “AttachedPDFForm” that displays PDF names. The subform displays the names of PDFs in a text control named PDFName and has a button to View PDF with the following code:

Dim filepath As String

filepath = "C:\Users\nevadamax\OneDrive\Documents\PMPlus" & Forms![InvoicesForm]![AttachedPDFForm].Form![PDFName]

DoCmd.OpenForm "ViewItPDFForm", , , , , acDialog

When the form “ViewItPDFForm” is opened, it has two controls filer and ViewPDF. Filer is a text box and correctly displays the full path to the PDF. ViewPDF is an AdobePDF Reader ActiveX control.

The OnOpen of ViewItPDFForm has the following code:

Me!filer = "C:\Users\nevadamax\OneDrive\Documents\PMPlus" & Forms![InvoicesForm]![AttachedPDFForm].Form![PDFName]

Me!ViewPDF.src = "C:\Users\nevadamax\OneDrive\Documents\PMPlus" & Forms![InvoicesForm]![AttachedPDFForm].Form![PDFName]

I have installed Adobe Reader.

However, no PDF is displayed. What am I doing wrong???

 

Access Development
Access Development
Access: A family of Microsoft relational database management systems designed for ease of use.Development: The process of researching, productizing, and refining new or existing technologies.
883 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Olaf Helper 45,121 Reputation points
    2024-05-29T18:33:42.1433333+00:00

    Me!filer = "C:\Users\nevadamax

    The property name "filer" can't be rigth, turn on "Option Strict", avoid last binding, don't use "!" to access properties and compile your code; simply do it the rigth way.

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.