Hi Jindon,
I tried the following but it does the same thing?
Private Sub CommandButton142_Click()
FileName = Me.TBM1Serial
If FileName = vbNullString Then
MsgBox "No Serial number available."
Me.TBM1Serial.SetFocus
Exit Sub
End If
Const strFldrPath As String = "C:\Documents and Settings\carl.walker\My Documents\Reports\"
Dim CurrentFile As String, myPath As String
Dim FileFound As Boolean: FileFound = False
myPath = strFldrPath & cmbDERS
If Right$(myPath, 1) <> "\" Then myPath = myPath & "\"
MsgBox Dir(myPath, 16) ' this one
If myPath = "" Then
MsgBox "No such folder":
Exit Sub
End If
CurrentFile = Dir(myPath & "*" & FileName & "*", 0)
If Len(CurrentFile) Then
ActiveWorkbook.FollowHyperlink (myPath & CurrentFile)
FileFound = True
End If
If FileFound = False Then
MsgBox Title:="File Not Found", _
Prompt:="File """ & FileName & """ not found in " & myPath
End If
End Sub
Bookmarks