I’m trying to make a browser for find a PDF file in directory (C.
In the process of finding a way to do the browser, I found this method for ACCESS2003:
Private Sub cmdBrowse_Click()
Dim VFile As String
On Error GoTo cmdBrowse_Click_Err
ChDrive ("C")
ChDir ("C:\")
cmDialog1.Filter = "All Files (*.*)|*.*| _ Text Files (*.txt)|*.txt|Excel WorkBooks (*.xls)|*.xls" cmDialog1.FilterIndex = 1
cmDialog1.Action = 1
If cmDialog1.FileName = "" Then
VFile = cmDialog1.FileName
Me!lbldb = VFile
End If
cmdBrowse_Click_Exit:
Exit Sub
cmdBrowse_Click_Err:
MsgBox Err.Description, , "cmdBrowse_Click"
Resume cmdBrowse_Click_Exit
End Sub
When I use the code the following error appears:
Compile error:
Syntax error
In the process of finding a way to do the browser, I found this method for ACCESS2003:
Private Sub cmdBrowse_Click()
Dim VFile As String
On Error GoTo cmdBrowse_Click_Err
ChDrive ("C")
ChDir ("C:\")
cmDialog1.Filter = "All Files (*.*)|*.*| _ Text Files (*.txt)|*.txt|Excel WorkBooks (*.xls)|*.xls" cmDialog1.FilterIndex = 1
cmDialog1.Action = 1
If cmDialog1.FileName = "" Then
VFile = cmDialog1.FileName
Me!lbldb = VFile
End If
cmdBrowse_Click_Exit:
Exit Sub
cmdBrowse_Click_Err:
MsgBox Err.Description, , "cmdBrowse_Click"
Resume cmdBrowse_Click_Exit
End Sub
When I use the code the following error appears:
Compile error:
Syntax error