Results 1 to 7 of 7
  1. #1
    Join Date
    Jul 2007
    Posts
    29

    Unanswered: Undo a form delete?

    I am pretty sure I know the answer to this already, but need to ask. If you accidentally deleted a form I didn't wish too. What would you do to try and recover it?

  2. #2
    Join Date
    Jan 2007
    Location
    California, USA
    Posts
    520
    I would go to the most recent copy of my database that I had saved to a new name just before doing a compact & repair. Other than that, I would start recreating the form from my own memory.

  3. #3
    Join Date
    May 2005
    Location
    Nevada, USA
    Posts
    2,888
    Provided Answers: 6
    And if you can't find that recent copy, then a restore from your tape (or other media) backup would be in order. Given the question, I'm guessing you don't have any of that, so Vic's option "B" is probably your only solution.
    Paul

  4. #4
    Join Date
    Jul 2007
    Posts
    29
    I had a semi recent copy from option A. I spent about 6 hours on it yesterday so I hadn't yet backed it up again. I figured it was worth asking anyway. Thanks guys.

    -Jerry

  5. #5
    Join Date
    Feb 2004
    Location
    Chicago, IL
    Posts
    1,312
    I forget the details, but my understanding is that the object is not deleted until you compact the database. Hold on, I will try to remember what table you modify to get it back.

  6. #6
    Join Date
    Feb 2004
    Location
    Chicago, IL
    Posts
    1,312
    I may have been mistaken. I found some code to recover a table that has been deleted:

    Code:
    Function UnDeleteTable(Optional sName As String)
    
        Dim db As DAO.DATABASE
        Dim tdf As DAO.TableDef
        Dim sTable As String
        Dim sSQL As String
        Dim sMsg As String
    
        If IsMissing(sName) Then sName = "RestoredTable"
        If Len(sName) = 0 Then sName = "RestoredTable"
        
        Set db = CurrentDb()
    
        For Each tdf In db.TableDefs
            If Left(tdf.Name, 4) = "~tmp" Then
               sTable = tdf.Name
               sSQL = "SELECT [" & sTable & "].* INTO " & sName
               sSQL = sSQL & " FROM [" & sTable & "];"
               
               db.Execute sSQL
               
               sMsg = "A deleted table has been restored as " & sName
               MsgBox sMsg, vbOKOnly, "Restored"
               GoTo Exit_Undelete
            End If
        Next
        
        ' If the code has fallen to this point, then no deleted
        ' tables exist in the catalog and none are recoverable.
        MsgBox "No Recoverable Tables Found", vbOKOnly, "Not Found"
    
    Exit_Undelete:
         Set db = Nothing
         Exit Function
         
    Err_Undelete:
         MsgBox Err.Description
         Resume Exit_Undelete
    
    End Function
    But I don't see that there is a way to recover a form.

  7. #7
    Join Date
    Nov 2004
    Location
    Norway
    Posts
    441
    Yes deleted tables can under some circumstance be recovered with full information (here's an MS KB article on it http://support.microsoft.com/?id=209874), but recovering deleted records are another story.

    Here's a newsgroup discussion, where some of the details in the concept is discussed http://groups.google.com/group/micro...74e8c2305907e/

    Backups are one way of dealing with issues like this, another way, is to completely disallow any actual deletions. Use a boolean field (Yes/No) to denote whether the record is "deleted" or not. That way, "recovery" is simple.

    Then at certain intervals, do some housecleaning (actual deletion, archiving...)
    Roy-Vidar

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •