I am going to delete those subform records whose checkmark value is none I mean unchecked and OTID (int) is equal to mainform which is F_EmpOTHeader.
CheckRightOT is a checkmark (Bit type field) and available in each records in Subform.
But producing Run-time error 13 - type mismatch on
strSQL = "DELETE * FROM T_EmpOTFooter WHERE CheckRightOT.value = false " And " OTID = " & Forms!F_EmpOTHeader!OTID
Can you please advise where is wrong?
CheckRightOT is a checkmark (Bit type field) and available in each records in Subform.
Code:
Private Sub OMApproval_Click()
Dim Msg As String, Style As Integer, Title As String, Response As Integer
Dim strSQL As String
Msg = "You are about to delete all unchecked entries from sub-form."
Style = vbOKCancel + vbQuestion + vbDefaultButton2
Title = "Continue?"
Response = MsgBox(Msg, Style, Title)
If Response = vbOK Then
strSQL = "DELETE * FROM T_EmpOTFooter WHERE CheckRightOT.value = false " And " OTID = " & Forms!F_EmpOTHeader!OTID
CurrentDb.Execute dbFailOnError
Me!SF_EmpOTFooter.Form.Requery
Else
MsgBox "No record deleted", vbOKOnly, "Info"
End If
End Sub
But producing Run-time error 13 - type mismatch on
strSQL = "DELETE * FROM T_EmpOTFooter WHERE CheckRightOT.value = false " And " OTID = " & Forms!F_EmpOTHeader!OTID
Can you please advise where is wrong?