Hello,
I am using Access 2016. My database tracks training records. There is a form used to enter new training records. "frmInputTrng" I also have a form which is used to search for training records already entered. "frmSearchTrng"
Both forms use control source of "tblTrngRecords". There is a text field used to store the file path to where the PDF of the signed training certificate is stored. "certLocation".
On frmInputTrng, I have a button that opens the PDF - this was my simple solution to ensure the data entry personnel typed the right file path. If the pdf opens, then the file path is correct. The code is,
HTML Code:
Dim fileLocat As String
fileLocat = Me.txtcertLocat.value
Application.FollowHyperlink filelocat
txtcertlocat = the text box on frmInputTrng where the filepath is entered by the user.
This works great! However...
On frmSearchTrng there is a continuous subform, "frmSearchSub" used to display the pertinent information on each record (Name, Date, Training Type, etc.). Also on frmSearchSub is a command button to open the pdf associated with that record.
The code I am using is,
HTML Code:
Dim fileLocat as String
fileLocat = Me.certlocation.value
Application.FollowHyperlink filelocat
The button is 'repeated' for each record as it is a continuous form. However, no matter which record I seek to open (click on) I get a Runtime Error 490.
What confuses me even more is that an earlier iteration of the database (which as far as I can tell is exactly identical as far as the pertinent forms goes) this code is the same and it works fine.
I have poured through the forum but cannot ascertain why the code works on one form and not the other. Or why it worked in an older iteration of the database (on the currently problematic form) but not now. Any ideas are greatly appreciated!