Hey everyone,
I am obviously missing something with this code, only I can't figure out what it is. On the double click event of my UNBOUND list box, I am trying to delete the record selected. My code is as follows:
I am getting a run-time error '3075' Syntax error (missing operator) in query expression 'TempContracture.ContractureSite = Left Finger'.
When I debug and hold my curser over strContractureSite it shows the value as "Left Finger", which is the correct record. I get the feeling that, once again, I am missing the obvious. Any help would be most appreciated!
I am obviously missing something with this code, only I can't figure out what it is. On the double click event of my UNBOUND list box, I am trying to delete the record selected. My code is as follows:
Code:
Private Sub LstContracture_DblClick(Cancel As Integer)
Dim sqlDeleteContractureRcd As String
Dim strContractureSite As String
Me.CboContractureSite = Me.LstContracture.Column(1)
Me.TxtContractureDegree = Me.LstContracture.Column(2)
strContractureSite = Me.CboContractureSite
DoCmd.SetWarnings False ' Turn warnings messages off while doing delete
sqlDeleteContractureRcd = "DELETE TempContracture.* FROM TempContracture WHERE TempContracture.ContractureSite = " & strContractureSite
DoCmd.RunSQL sqlDeleteContractureRcd
DoCmd.SetWarnings True
Call FillLstContractureInfoListBox
End Sub
I am getting a run-time error '3075' Syntax error (missing operator) in query expression 'TempContracture.ContractureSite = Left Finger'.
When I debug and hold my curser over strContractureSite it shows the value as "Left Finger", which is the correct record. I get the feeling that, once again, I am missing the obvious. Any help would be most appreciated!