Results 1 to 8 of 8
  1. #1
    b.saimsc is offline Novice
    Windows 7 32bit Access 2010 32bit
    Join Date
    Sep 2012
    Posts
    24

    Thumbs up Unable to pull back delete record

    Hi all,



    I have problem in my form. I have kept two command button 1 is for delete record it's works fine & another one is Undo record but it's not working.
    For Delete Record:

    Private Sub Command_Click()
    DoCmd.RunCommand acCmdDeleteRecord
    End Sub
    It's working........................

    For Undo:

    Private Sub Command2_Click()
    Me.Undo
    End Sub

    Undo is not working please help me

    Thanks in advance

  2. #2
    June7's Avatar
    June7 is online now VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,816
    You want to undo record deletion? Can't Undo record deletion. Once it's gone, it's gone.

    Undo should work only to undo edits of record.
    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.

  3. #3
    b.saimsc is offline Novice
    Windows 7 32bit Access 2010 32bit
    Join Date
    Sep 2012
    Posts
    24
    Undo record Deletion can't work in Access?

  4. #4
    June7's Avatar
    June7 is online now VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,816
    Can't undo record deletion. Record deleted is gone. That's why there is a warning message when deleting with the keyboard Delete key.
    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.

  5. #5
    alcapps is offline Competent Performer
    Windows 8 Access 2010 32bit
    Join Date
    Jan 2012
    Posts
    292
    If that is something that you want too do is keep deleted records?
    you can do it by faking a deletion, in other words you have your normal table but add a yes no or date field your choice. You handle the deletes manually by marking them deleted setting the date or y for deleted. In your normal forms data source you have too filter for n or null deleted record fields. Very manual process but it keeps records forever or until someone accidentally runs a delete query.

  6. #6
    June7's Avatar
    June7 is online now VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,816
    Good advice Al. Deleting can be an issue if there are relationships. Instead have a field to set record status. Such as 'Closed' or 'Pending', etc. or a DateClosed field. Then apply filter.

    So b, why do you want to allow record deletion? This should be a rare event in a relational database.
    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.

  7. #7
    tmd63 is offline Novice
    Windows 7 64bit Access 2003
    Join Date
    Oct 2016
    Location
    UK
    Posts
    16
    You could try transactional process instead. There you can delete any number of files and they will be held in limbo until to complete the transaction.
    I used it for a very large MRPII database with multiple users. The transactions were used to move stock from the instock database container to a work-in-progress database container. If I did this on a per item method, someone could delete or process a similar item at the same time. But with transactional processes, the whole was not moved until the final 'commit' action was performed.

  8. #8
    Missinglinq's Avatar
    Missinglinq is offline VIP
    Windows 7 64bit Access 2007
    Join Date
    May 2012
    Location
    Richmond (Virginia, not North Yorkshire!)
    Posts
    3,016
    The advice given by alcapps and June7 is pretty much the standard approach used by experienced Access developers vis-à-vis 'deleting' Records. It allows for the retention/availability of historic Records, more and more a requirement in today's world of 'everything is on computer,' as well as the easy retrieval of Records that were accidentally deleted, as in your scenario.

    Linq ;0)>
    The problem with making anything foolproof...is that fools are so darn ingenious!

    All posts/responses based on Access 2003/2007

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

Similar Threads

  1. turn "about to delete record" warning back on
    By markjkubicki in forum Programming
    Replies: 1
    Last Post: 11-01-2012, 12:21 PM
  2. unable to delete a hyperlink record
    By markjkubicki in forum Programming
    Replies: 3
    Last Post: 03-15-2012, 10:57 AM
  3. Trying to Delete record using delete query
    By MooseOTL in forum Access
    Replies: 13
    Last Post: 10-04-2011, 02:30 AM
  4. Random Record pull
    By Madmax in forum Access
    Replies: 2
    Last Post: 06-28-2011, 08:26 PM
  5. cannot pull the correct record
    By simba in forum Reports
    Replies: 1
    Last Post: 11-30-2010, 10:45 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