Minggu, 28 Februari 2021

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

The dbSeeChanges is not part of the SQL statement.

strSql = "DELETE * FROM T_EmpOTFooter WHERE OTID= " & Forms!F_EmpOTHeader!OTID & " And Verified = 0", dbSeeChanges

You can copy from the debug window and paste/modify it in a new blank query SQL view to view the results:

SELECT * FROM T_EmpOTFooter WHERE OTID= 3 And Verified = 0

Regards,
Duane

From: MSAccessProfessionals@groups.io <MSAccessProfessionals@groups.io> on behalf of SAYYED ASHFAQUE HUSSAIN via groups.io <ashfaque_online=yahoo.com@groups.io>
Sent: Sunday, February 28, 2021 12:24 AM
To: MSAccessProfessionals@groups.io <MSAccessProfessionals@groups.io>
Subject: Re: [MSAccessProfessionals] Type Mismatch Run-time error ...Tired of this issue...
 
Thanks Duane Hookom,

The debug print is giving following result:

DELETE * FROM T_EmpOTFooter WHERE OTID= 3 And Verified = 0

It means he is not picking up Verified field data. For this main record # 3, there are 5 footer records out of which 2 are unchecked so I  need them to delete from footer tbl and keep rest 3 saved.

And when it is reaching to execute below:
CurrentDb.Execute strSql, dbFailOnError
It produces Run-time error 3622
"You must use the dbSeeChanges option with OpenRecordset when accessing a SQL Server table that has an Identity Column.

When I tried with below:
 strSql = "DELETE * FROM T_EmpOTFooter WHERE OTID= " & Forms!F_EmpOTHeader!OTID & " And Verified = 0 dbSeeChanges"

Syntax error - Missing Operator

Please advise...

Tidak ada komentar:

Posting Komentar