Kamis, 25 Februari 2021

[MSAccessProfessionals] Type Mismatch Run-time error ...Tired of this issue...

Hi,

My BE is on SQL Server whereas FE in off course in Access. I have a header form and a sub-form added into. This is you can say one-to-many record register. It is register to record dept wize overtime of the employee.

I have below code thru which I want to delete those record which have UNCHECKED (Bit type field on server).

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 the problem is it always producing above error.
With some of people suggestion I changed to StrSQL line as follows but still same error.
Please note that OMApproval is checkmark on my header form.
strSQL = "DELETE * FROM T_EmpOTFooter WHERE OTID = " & Forms!F_EmpOTHeader!OTID & " And CheckRightOT = 0; " 

Still same....please advise.
Thank you in Advance...
_._,_._,_

Groups.io Links:

You receive all messages sent to this group.

View/Reply Online (#115864) | Reply To Group | Reply To Sender | Mute This Topic | New Topic
Your Subscription | Contact Group Owner | Unsubscribe [sugeng.panjalu.access@blogger.com]

_._,_._,_

Tidak ada komentar:

Posting Komentar