R
Randall Arnold
I have a subform set up as continuous to handle the many records in a
1-to-many relationship. I needed the ability to delete any of the records
and figured I could just add a button tied to a delete module and clicking
the one beside a record would delete that record-- wrong. No matter which
of the many records on the continuous subform I select, the first record is
always the one deleted.
My code is below:
Private Sub FailDelete_button_Click()
If Me.Recordset.EditMode = dbEditNone Then
' delete record(s) and requery--grab proper record!!!!
Me.Recordset.Delete
Me.Requery
Else
' cancel current operation
On Error Resume Next
Me.Recordset.CancelUpdate
Me.Undo
End If
End Sub
Any ideas what I need to do to get the right record to be deleted? First
time I've ever run across this and nothing I've tried has made a difference.
Thanks,
Randall Arnold
1-to-many relationship. I needed the ability to delete any of the records
and figured I could just add a button tied to a delete module and clicking
the one beside a record would delete that record-- wrong. No matter which
of the many records on the continuous subform I select, the first record is
always the one deleted.
My code is below:
Private Sub FailDelete_button_Click()
If Me.Recordset.EditMode = dbEditNone Then
' delete record(s) and requery--grab proper record!!!!
Me.Recordset.Delete
Me.Requery
Else
' cancel current operation
On Error Resume Next
Me.Recordset.CancelUpdate
Me.Undo
End If
End Sub
Any ideas what I need to do to get the right record to be deleted? First
time I've ever run across this and nothing I've tried has made a difference.
Thanks,
Randall Arnold