Results 1 to 2 of 2
  1. #1
    MFS is offline Competent Performer
    Windows 7 64bit Access 2010 64bit
    Join Date
    Mar 2009
    Location
    Ohio
    Posts
    235

    Delete Record

    Hello all,
    I am trying to delete a record in a table by having a command button on my form.


    When the Delete button is pressed I would like it to ask me "Enter part number" then show those fields related to that part number on my form or inform part number does not exist. If data does exist I would like to be able to review data and confirm delete.
    I've tried but have been unsuccessful.
    Hopefully someone can help me.
    Mike

  2. #2
    MFS is offline Competent Performer
    Windows 7 64bit Access 2010 64bit
    Join Date
    Mar 2009
    Location
    Ohio
    Posts
    235
    Found this VB.
    Private Sub DeleteButton_Click()
    If MsgBox(Prompt:="My question", Buttons:=vbYesNo) = vbYes Then
    CurrentDb.Execute "DELETE FROM tablename WHERE ID=" & Me.ID
    Else
    MsgBox "Delete canceled"
    End If
    End Sub

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 12
    Last Post: 10-27-2012, 05:44 AM
  2. Replies: 3
    Last Post: 10-19-2012, 04:30 PM
  3. Trying to Delete record using delete query
    By MooseOTL in forum Access
    Replies: 13
    Last Post: 10-04-2011, 02:30 AM
  4. Delete Record; Yes/No
    By mar_t in forum Access
    Replies: 5
    Last Post: 03-10-2011, 07:15 AM
  5. Delete a record
    By f.crocco in forum Programming
    Replies: 1
    Last Post: 10-08-2007, 07:28 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums