Try below sub
Private Sub cmdOpenEmpFolder_Click()
Dim partialName As String, partialFolder As String
Dim folderName As String
Dim folderfullPath As String
partialName = CStr(Me.txtEmployeeID)
partialFolder = Application.CurrentProject.Path & ""
folderName = Dir(partialFolder & "*" & partialName, vbDirectory)
folderfullPath = partialFolder & folderName
Debug.Print "explorer.exe " & Chr(34) & folderfullPath & Chr(34)
Shell "explorer.exe " & Chr(34) & folderfullPath & Chr(34), vbNormalFocus
End Sub
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…