Results 1 to 2 of 2
  1. #1
    TKTheKid is offline Advanced Beginner
    Windows 7 64bit Access 2010 64bit
    Join Date
    Nov 2012
    Posts
    35

    Deleting certain rows in a table based on a combobox selection?

    Hi all,

    Please see form formWarehouseData in the attached database file.

    On the right, I have combobox comboVoidTicket set with a source of all of the unique Ticket values from tableWarehouseData.

    I'd like to be able to click the Void button (commandVoid) to delete all records in tableWarehouseData that have the ticket value that was selected in comboVoidTicket. The deletion should ONLY happen after the user has been asked if they are sure with a message box, similar to how it is in prodecure Command55_Click.

    What should procedure commandVoid_Click() look like then?

    Thanks a lot!

    Tony
    Attached Files Attached Files

  2. #2
    June7's Avatar
    June7 is offline VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,815
    Try:

    If MsgBox("Do you want to delete tickets?", vbYesNo) = vbYes Then
    CurrentDb.Execute "DELETE FROM tableWarehouseData WHERE Ticket=" & Me.comboVoidTicket
    End If
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

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

Similar Threads

  1. Replies: 1
    Last Post: 09-06-2011, 01:47 PM
  2. Replies: 29
    Last Post: 08-16-2011, 05:52 PM
  3. Replies: 6
    Last Post: 07-28-2011, 04:07 AM
  4. Replies: 0
    Last Post: 08-24-2010, 06:38 PM
  5. Replies: 0
    Last Post: 12-16-2009, 01:14 PM

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