I am trying to write a code and am failing miserably. I have a command button in a subform...I would like to click on that button and have a .pdf file (associated with the current entry) open in a program other than Adobe Acrobat. The file paths are entered as a field in a table called tblWellLogs, the field is "FileLoc".
I get the error "can't find the field 'File Loc' referred to in your expression"...if I remove "strFile etc" the program opens fine but of course no file. Please help if you can--I also tried opening the program and then opening a hyperlink to the file using VBA and it did not work
Here's my code:
Dim strProg As String
Dim strFile As String
strProg = "C:\nds\bin\NeuraView.exe"
strFile = Me!FileLoc
Call Shell(strProg & " " & strFile, vbMaximizedFocus)
I get the error "can't find the field 'File Loc' referred to in your expression"...if I remove "strFile etc" the program opens fine but of course no file. Please help if you can--I also tried opening the program and then opening a hyperlink to the file using VBA and it did not work
Here's my code:
Dim strProg As String
Dim strFile As String
strProg = "C:\nds\bin\NeuraView.exe"
strFile = Me!FileLoc
Call Shell(strProg & " " & strFile, vbMaximizedFocus)