Delete button in Form (1 Viewer)

mrrayj60

Registered User.
Local time
Today, 02:12
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
 

Uncle Gizmo

Nifty Access Guy
Staff member
Local time
Today, 06:12
Joined
Jul 9, 2003
Messages
16,245
Do you mean it shows "Deleted" where the record was?
 

mrrayj60

Registered User.
Local time
Today, 02:12
Joined
Sep 3, 2009
Messages
103
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
 

Galaxiom

Super Moderator
Staff member
Local time
Today, 17:12
Joined
Jan 20, 2009
Messages
12,849
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
 

mrrayj60

Registered User.
Local time
Today, 02:12
Joined
Sep 3, 2009
Messages
103
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: 91
  • 2 shows deleted.jpg
    2 shows deleted.jpg
    72.4 KB · Views: 100
  • 3 shows blank record left in table.jpg
    3 shows blank record left in table.jpg
    68.6 KB · Views: 96
  • 4 shows its a new record.jpg
    4 shows its a new record.jpg
    58 KB · Views: 86

Users who are viewing this thread

Top Bottom