Hi Curtis,
It looks like it is because my file isn't a exe file type ...
Correct. The Shell program runs an executable program and returns a Variant
(Double) representing the program's task ID if successful, otherwise it
returns zero. Your stAppName variable does not evaluate to the name of an
executable program.
Try the procedure shown below. Add a break point to the line of code that
reads:
Application.FollowHyperlink stAppName
Click on your command button. Open the Immediate Window (Ctrl G), and
inspect the results. Are you seeing a valid path that points to your file? If
so, you should be able to copy the output shown in the Immediate Window, and
paste it into the Start > Find > Files or Folders dialog, and it should find
the file in question. If not, make the necessary adjustments. When finished,
either comment out the Debug.Print statement, or delete it.
Option Compare Database
Option Explicit
Private Sub cmdDisplayImage_Click()
On Error GoTo ProcError
Dim stAppName As String
stAppName = "C:\Customers\" & Me.CustomerID & "\MerchantApplication.tif"
Debug.Print stAppName
Application.FollowHyperlink stAppName
ExitProc:
Exit Sub
ProcError:
MsgBox "Error " & Err.Number & ": " & Err.Description, _
vbCritical, "Error in cmdDisplayImage_Click event procedure..."
Resume ExitProc
End Sub
Tom Wickerath
Microsoft Access MVP
http://www.access.qbuilt.com/html/expert_contributors.html
http://www.access.qbuilt.com/html/search.html
__________________________________________