M
MMcCalmon
The following code is attached to a command button on a subform thatis
supposed to delete the selected record, but it's not working.
The subform is record source is a query. The subform properties have
the AllowEdits and AllowDeletes propertry set to true.
Private Sub cmdDelete_Click()
' Purpose: to delete the current record from the subform
' listing the existing applied BMPs.
'
Const cstrProc As String = "cmdDelete_Click"
On Error GoTo cmdDelete_Click_Err
Dim intCurRec As Integer
Set db = CurrentDb
intCurRec = Me.CurrentRecord
Set rs = db.OpenRecordset("trelActivityTracker")
With rs
..Move intCurRec - 1
..Delete
..Close
End With
Me.Requery
Forms!frmBMPBuilder.Requery
cmdDelete_Click_Exit:
Exit Sub
cmdDelete_Click_Err:
Call ErrMsgStd(Me.Name & "." & cstrProc, Err.Number, Err.Description,
True)
Resume cmdDelete_Click_Exit
End Sub
supposed to delete the selected record, but it's not working.
The subform is record source is a query. The subform properties have
the AllowEdits and AllowDeletes propertry set to true.
Private Sub cmdDelete_Click()
' Purpose: to delete the current record from the subform
' listing the existing applied BMPs.
'
Const cstrProc As String = "cmdDelete_Click"
On Error GoTo cmdDelete_Click_Err
Dim intCurRec As Integer
Set db = CurrentDb
intCurRec = Me.CurrentRecord
Set rs = db.OpenRecordset("trelActivityTracker")
With rs
..Move intCurRec - 1
..Delete
..Close
End With
Me.Requery
Forms!frmBMPBuilder.Requery
cmdDelete_Click_Exit:
Exit Sub
cmdDelete_Click_Err:
Call ErrMsgStd(Me.Name & "." & cstrProc, Err.Number, Err.Description,
True)
Resume cmdDelete_Click_Exit
End Sub