I have the below code on the double-click event. It works sometimes. The times it doesn't is when the ProblemDescription field (which is being used to match the record) has a quote in it. As an example, the problem description might read: I can't logon to the LAN. The ' in can't causes a problem Or if someone puts "" in their problem description. Here's the error message: Syntax error (missing operator) in query expression '[ProblemDescription]='I can't logon to the LAN".
Anyone know how to fix this? Thanks in advance.
Amy
Private Sub ProblemDescription_DblClick(Cancel As Integer)
On Error GoTo Err_cmdFullView_Click
Dim stDocName As String
Dim stLinkCriteria As String
stDocName = "frmOpenTickets"
stLinkCriteria = "[ProblemDescription]=" & "'" & Me![ProblemDescription] & "'"
DoCmd.OpenForm stDocName, , , stLinkCriteria
Exit_cmdFullView_Click:
Exit Sub
Err_cmdFullView_Click:
MsgBox Err.Description
Resume Exit_cmdFullView_Click
End Sub
Anyone know how to fix this? Thanks in advance.
Amy
Private Sub ProblemDescription_DblClick(Cancel As Integer)
On Error GoTo Err_cmdFullView_Click
Dim stDocName As String
Dim stLinkCriteria As String
stDocName = "frmOpenTickets"
stLinkCriteria = "[ProblemDescription]=" & "'" & Me![ProblemDescription] & "'"
DoCmd.OpenForm stDocName, , , stLinkCriteria
Exit_cmdFullView_Click:
Exit Sub
Err_cmdFullView_Click:
MsgBox Err.Description
Resume Exit_cmdFullView_Click
End Sub