TrevorAaron
Technical User
Hello Everyone,
I've been struggling with a VB error I keep getting. The error is a "Compile Error: Method or data not found".
I found the code on an old thread here.
Here's the link:
I'm trying to do the same thing as what says in the post, place a browse button on a form in access so that the user can open and select from a bunch of files locally and copy the path of the filename and place it into a text box to select later. I copied the code and updated the references to the appropriate names. Here's my code:
The error highlights on the first ".filter =". I have a text box named "txtOximeterReport". My button is named "cmdBrowse". The event procedure is placed in "On Click". I've tried searching all over the web on how to solve this error and haven't found anything. Am I referencing incorrectly?
I've been struggling with a VB error I keep getting. The error is a "Compile Error: Method or data not found".
I found the code on an old thread here.
Here's the link:
I'm trying to do the same thing as what says in the post, place a browse button on a form in access so that the user can open and select from a bunch of files locally and copy the path of the filename and place it into a text box to select later. I copied the code and updated the references to the appropriate names. Here's my code:
Code:
Private Sub cmdBrowse_Click()
Dim VFile As String
On Error GoTo cmdBrowse_Click_Err
ChDrive ("S")
ChDir ("S:\")
txtOximeterReport.Filter = "All Files (*.*)|*.*|txtOximeterReport.FilterIndex = 1"
txtOximeterReport.FilterIndex = 1
txtOximeterReport.Action = 1
If txtOximeterReport.FileName <> "" Then
VFile = txtOximeterReport.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
The error highlights on the first ".filter =". I have a text box named "txtOximeterReport". My button is named "cmdBrowse". The event procedure is placed in "On Click". I've tried searching all over the web on how to solve this error and haven't found anything. Am I referencing incorrectly?