Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Make a browser for find a PDF file in directory (C:) ACCESS 2010? 1

Status
Not open for further replies.

jmasm

Programmer
Sep 1, 2010
22
PT
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




 
Which line is highlighted ?

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
The Line is:
cmDialog1.Filter = "All Files (*.*)|*.*| _ Text Files (*.txt)|*.txt|Excel WorkBooks (*.xls)|*.xls" cmDialog1.FilterIndex = 1
 
cmDialog1.Filter = "All Files (*.*)|*.*| _ Text Files (*.txt)|*.txt|Excel WorkBooks (*.xls)|*.xls"
cmDialog1.FilterIndex = 1

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top