Please, can someone help me? My problem:
I have put a command button onto a form, which retrieves two field values from the current record. With these two values, I am able to open a document from Access.
Default value of field "documentname" is "x"
Running the code, I get a syntax error
The code:
Expand|Select|Wrap|Line Numbers
- Private Sub Knop46_Click()
- Dim path As String
- Dim name As String
- path = "c:\Documents and Settings\Test\My Documents\Docs\"
- name = Trim(Me!documentname)
- If name="x" <------ here I get a syntax error!
- Then
- MsgBox "No filename present (x = no name exists)"
- Else
- Application.FollowHyperlink [path] & [name]
- End If
- End Sub