Greetings i been around the forum for sometime and i really found helpful everything in here.. but now i have a "I don't know/don't find it case" place take a look at my code, for some reason is no erasing the data.
thanks for your help ^^
Code:
Private Sub btnDeleteLst_Click()
'If no record is selected just leave the sub
If IsNull(txtDispDate) Then
Exit Sub
End If
Dim strSQL As String
DoCmd.SetWarnings False
'strSQL = "DELETE " & _
' "FROM [Shift DT] " & _
' "WHERE [Shift DT].Inspector= '" _
' & Me!lstDisplayData.Column(1) & "' AND [Shift DT].Date= " & Me!lstDisplayData.Column(2) & _
' " AND [Shift DT].StartTime= #" & Me!lstDisplayData.Column(3) & "# AND [Shift DT].FinishTime= #" _
' & Me!lstDisplayData.Column(4) & "# AND [Shift DT].Comments = '" & Me!lstDisplayData.Column(5) & "';"
DoCmd.RunSQL ("DELETE " & _
"FROM [Shift DT] " & _
"WHERE [Shift DT].Inspector= '" _
& Me!lstDisplayData.Column(1) & "' AND [Shift DT].Date= " & Me!lstDisplayData.Column(2) & _
" AND [Shift DT].StartTime= #" & Me!lstDisplayData.Column(3) & "# AND [Shift DT].FinishTime= #" _
& Me!lstDisplayData.Column(4) & "# AND [Shift DT].Comments = '" & Me!lstDisplayData.Column(5) & "';")
Me!lstDisplayData.Requery ' requery the list
End Sub