Here's the public function:
Expand|Select|Wrap|Line Numbers
- Function Open_eChart(strChartNum As String)
- On Error GoTo Err_Open_eChart
- Dim retVal As Variant
- Dim strPartialPath As String
- Const conPAth As String = "V:\IUR\eCharts\"
- If IsNull(strChartNum) Then Exit Function
- strPartialPath = Replace(Replace(strChartNum, "\", ""), ",", "_")
- If Dir$(conPAth & strPartialPath, vbDirectory) = "" Then MkDir (conPAth & strPartialPath)
- retVal = Shell("Explorer.exe " & conPAth & strPartialPath, vbNormalFocus)
- Exit_Open_eChart:
- Exit Function
- Err_Open_eChart:
- MsgBox Err.Description
- Resume Exit_Open_eChart
- End Function
Expand|Select|Wrap|Line Numbers
- Private Sub Open_eChart_Click()
- 'Open_eChart Me![ChartNum]
- Open_eChart (Me![ChartNum])
- End Sub
(Also, do you think I need the error handling in the public function? It seems pretty sturdy on its own, but I don't know.)