Sabtu, 27 Februari 2021

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

Please include the previous reply in your post so we understand what was stated before.  
The Debug.Print strSQL is there for a reason. Did you open the debug window (press Ctrl+G) to see the result?

I don't believe you ever answered the question about the data type of OTiD. The code assumes it's numeric. Is the code being run in the form F_EmpOTHeader?

strSql = "DELETE * FROM T_EmpOTFooter WHERE OTID= " & Forms!F_EmpOTHeader!OTID & " And Verified = 0"
   Debug.Print strSql
    CurrentDb.Execute strSql, dbFailOnError

Regards,
Duane

From:  SAYYED ASHFAQUE HUSSAIN via groups.io <ashfaque_online=yahoo.com@groups.io>
 
Thanks Paul,

I have renamed my footer tbl field from CheckRightOT  to "Verified " and then tried with following 
 
strSql = "DELETE * FROM T_EmpOTFooter WHERE OTID= " & Forms!F_EmpOTHeader!OTID & "  And  " & Verified = 0         
   Debug.Print strSql
    CurrentDb.Execute strSql, dbFailOnError

It says Verified variable not defined. Whereas Verified is checkmark of reach record in footer table

Please help. The only Idea is to delete all those records from footer tbl (form) which are not checked.

Tidak ada komentar:

Posting Komentar