I'm executing this sql.
But AffectedRecords returns 0.
The record is successfully added to the table.
Why is that?
Thanks.
But AffectedRecords returns 0.
The record is successfully added to the table.
Why is that?
Thanks.
Code:
sql = "INSERT INTO tblManuProcess ("
sql = sql & "ManuProcessManuFK, ManuProcessProcessFK, ManuProcessUserFK, "
sql = sql & "ManuProcessDate, ManuProcessCount, ManuProcessInspector"
sql = sql & ") VALUES ("
sql = sql & "P1,P2,P3,P4,P5,P6"
sql = sql & ")"
With CurrentDb.CreateQueryDef("", sql)
.Parameters("P1") = txtManuPK
.Parameters("P2") = ProcessFK
.Parameters("P3") = cmbUser
.Parameters("P4") = GetCurrentDate
.Parameters("P5") = txtManuCount
.Parameters("P6") = cmbInspector
.Execute dbFailOnError
.Close
If CurrentDb.RecordsAffected > 0 Then
fltr = fltr & "," & .OpenRecordset("select @@identity")(0)
Else
MsgBox "Failed"
Exit Sub
End If
End With
Last edited: