Getting error in this code when I am deleting a record in a table:
Code:
'getting temp values
Dim Matrixtempvalue As Double
If Me.txtMatrixID = 1 Then
Martixtempvalue = Me.txtMatrixID + 1
Else
Matrixtempvalue = Me.txtMatrixID - 1
End If
MsgBox "Are you sure you like to delete this record?", vbYesNo, "Deleting Record"
If vbYes Then
Call Me.editform 'unlocks text boxes
DoCmd.DoMenuItem acFormBar, acEditMenu, 8, , acMenuVer70 'it errors out here.
DoCmd.DoMenuItem acFormBar, acEditMenu, 6, , acMenuVer70
MsgBox "Record Deleted", vbInformation
Call Me.noneditform 'locks text boxes
Dim Martrs As Object
Set Martrs = Me.Recordset.Clone
Martrs.FindFirst "[MatrixID] = " & str(Matrixtempvalue)
Me.Bookmark = Matrixrs.Bookmark
Else
MsgBox "Nothing Deleted"
End If
Me.Form.RecordSource = "SELECT tblMatrix.MatrixID, tblMatrix.EmpID, tblMatrix.TrainMatrixID, tblMatrix.LegendID, tblMatrix.MatrixDate " _
& " FROM tblMatrix " _
& " WHERE (((tblMatrix.EmpID)=[forms]![frmEmployee]![txtEMPID]));"
Me.Form.Requery
Me.lstMatrixTrain.Requery
DoCmd.SetWarnings True