Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Delete button on continuous form

Status
Not open for further replies.

jonwolds

Programmer
Aug 6, 2002
194
GB
Hi,

I want to create a delete button which appears against each record on a continuous form. The user can then click the delete button and it'll delete the row that it sits against.

Not sure how to do this

Thanks
Jon
 
This code works fine in my database. Put the command button in the details section of the form
Code:
Private Sub cmdDelete_Click()
On Error GoTo Err_cmdDelete_Click
    DoCmd.RunCommand acCmdDeleteRecord
Exit_cmdDelete_Click:
    Exit Sub
Err_cmdDelete_Click:
   Select Case Err.Number
   Case 2046
    MsgBox "You can't delete a blank record"
   Case Else
    MsgBox Err.Description, vbInformation, Err.Number
   End Select
    Resume Exit_cmdDelete_Click    
End Sub

Regards

Zameer Abdulla

 
Thanks very much, I'll give it a shot.
Jon
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top