G
Guest
created a command button with the wizard that opens a form based upon a name
in the current form and I get the error: Syntax error (missing operator) in
query expression '[]='fname o'last" when there's an apostrophe in the last
name.
The code the wizard created is:
Private Sub Command620_Click()
On Error GoTo Err_Command620_Click
Dim stDocName As String
Dim stLinkCriteria As String
stDocName = "Firm Contact"
stLinkCriteria = "[Engineer Name]=" & "'" & Me![Firm Contact] & "'"
DoCmd.OpenForm stDocName, , , stLinkCriteria
Exit_Command620_Click:
Exit Sub
Err_Command620_Click:
MsgBox Err.Description
Resume Exit_Command620_Click
End Sub
Any help is appreciated... I'm a rooky with Access...
in the current form and I get the error: Syntax error (missing operator) in
query expression '[]='fname o'last" when there's an apostrophe in the last
name.
The code the wizard created is:
Private Sub Command620_Click()
On Error GoTo Err_Command620_Click
Dim stDocName As String
Dim stLinkCriteria As String
stDocName = "Firm Contact"
stLinkCriteria = "[Engineer Name]=" & "'" & Me![Firm Contact] & "'"
DoCmd.OpenForm stDocName, , , stLinkCriteria
Exit_Command620_Click:
Exit Sub
Err_Command620_Click:
MsgBox Err.Description
Resume Exit_Command620_Click
End Sub
Any help is appreciated... I'm a rooky with Access...