C
cavyman
I have a "Delete Record" command button on my form, however it will not
delete the last record. For example, I have 29 records and when I
create a new record, the record count goes to 30 of 30 records. If I do
not enter anything into the new record on the form but just click
Delete Record instead, the record just stays blank and stays on record
30. If I create yet another new record (31 of 31), I can click to go
back to record 30 (of 31) and then delete record 30 thus taking it back
to 30 of 30 records. It will not go back to record 29 of 29 which is a
fully filled out record. I'm new to both Access and VBA, so I'm sorry
if this is a stupid question (or if I'm missing something simple). I've
been trying to teach myself how to do all of this, but this one has me
stumped. Thanks!
My code for the delete command button is:
Private Sub ProposalDelete_Click()
On Error GoTo Err_ProposalDelete_Click
DoCmd.RunCommand acCmdDeleteRecord
DoCmd.GoToRecord , , acPrevious
Exit_ProposalDelete_Click:
Exit Sub
Err_ProposalDelete_Click:
Resume Exit_ProposalDelete_Click
End Sub
delete the last record. For example, I have 29 records and when I
create a new record, the record count goes to 30 of 30 records. If I do
not enter anything into the new record on the form but just click
Delete Record instead, the record just stays blank and stays on record
30. If I create yet another new record (31 of 31), I can click to go
back to record 30 (of 31) and then delete record 30 thus taking it back
to 30 of 30 records. It will not go back to record 29 of 29 which is a
fully filled out record. I'm new to both Access and VBA, so I'm sorry
if this is a stupid question (or if I'm missing something simple). I've
been trying to teach myself how to do all of this, but this one has me
stumped. Thanks!
My code for the delete command button is:
Private Sub ProposalDelete_Click()
On Error GoTo Err_ProposalDelete_Click
DoCmd.RunCommand acCmdDeleteRecord
DoCmd.GoToRecord , , acPrevious
Exit_ProposalDelete_Click:
Exit Sub
Err_ProposalDelete_Click:
Resume Exit_ProposalDelete_Click
End Sub