Delete button in Form

mrrayj60

Registered User.
Local time
Today, 15:38
Joined
Sep 3, 2009
Messages
103
The delete button in my form was installed using the command button wizard.
When I delete a record it deletes the record but leaves a blank record and then I have to go and delete the blank record too. Is there a way to delete a record and not leave a blank? Thanks in advance - Ray :banghead:
Event - On Click Code

Private Sub Command130_Click()
On Error GoTo Err_Command130_Click
DoCmd.DoMenuItem acFormBar, acEditMenu, 8, , acMenuVer70
DoCmd.DoMenuItem acFormBar, acEditMenu, 6, , acMenuVer70

Exit_Command130_Click:
Exit Sub

Err_Command130_Click:
MsgBox Err.description
Resume Exit_Command130_Click

End Sub
 
Do you mean it shows "Deleted" where the record was?
 
I get the confirmation request, Do you want to delete 1 record? click yes and the record is deleted but it always leaves a totally empty blank record that I have to delete...its always done this so I am finally tired of it looking for the answer - Thanks Ray
 
Private Sub Command130_Click()
On Error GoTo Err_Command130_Click
DoCmd.DoMenuItem acFormBar, acEditMenu, 8, , acMenuVer70
DoCmd.DoMenuItem acFormBar, acEditMenu, 6, , acMenuVer70

Exit_Command130_Click:
Exit Sub

Err_Command130_Click:
MsgBox Err.description
Resume Exit_Command130_Click

End Sub

DoMenuItem has been deprecated for 20 years!
Use DoCmd.RunCommand acCmdDeleteRecord
 
New method installed but still leaves a blank record. Here are 4 snips from my form and table - as the last photo shows its a new record automatically numbered.
Thanks for all the help - Ray
 

Attachments

  • 1 blank record left.jpg
    1 blank record left.jpg
    58.1 KB · Views: 122
  • 2 shows deleted.jpg
    2 shows deleted.jpg
    72.4 KB · Views: 131
  • 3 shows blank record left in table.jpg
    3 shows blank record left in table.jpg
    68.6 KB · Views: 126
  • 4 shows its a new record.jpg
    4 shows its a new record.jpg
    58 KB · Views: 116

Users who are viewing this thread

Back
Top Bottom