Page 2 of 2 FirstFirst 12
Results 16 to 26 of 26
  1. #16
    Micron is offline Virtually Inert Person
    Windows 10 Access 2016
    Join Date
    Jun 2014
    Location
    Ontario, Canada
    Posts
    12,737

    Lookup CurrentDb.Execute as it's better than me trying to describe it and all of its details.
    The more we hear silence, the more we begin to think about our value in this universe.
    Paraphrase of Professor Brian Cox.

  2. #17
    Mac R is offline Advanced Beginner
    Windows 7 64bit Access 2013 64bit
    Join Date
    May 2022
    Location
    Maine, USA
    Posts
    39
    Thanks. I did yesterday on MS Docs and am excited about the possibilities. Appreciate the nudge.

  3. #18
    Micron is offline Virtually Inert Person
    Windows 10 Access 2016
    Join Date
    Jun 2014
    Location
    Ontario, Canada
    Posts
    12,737
    Good luck, and remember to back up the db periodically!
    The more we hear silence, the more we begin to think about our value in this universe.
    Paraphrase of Professor Brian Cox.

  4. #19
    Mac R is offline Advanced Beginner
    Windows 7 64bit Access 2013 64bit
    Join Date
    May 2022
    Location
    Maine, USA
    Posts
    39
    Kinda laughing here...

    Today is a day of data entry, trying to 1) get the data entered (duh), 2) Litmus test the application, 3) shake out bugs... SO while we are entering and making changes, we're SAVING!!!

    Click image for larger version. 

Name:	Recipe Directory.JPG 
Views:	13 
Size:	45.0 KB 
ID:	48065

    Maybe overkill, maybe not.... AND I've started using the Execute Method and I LIKE it!

  5. #20
    Micron is offline Virtually Inert Person
    Windows 10 Access 2016
    Join Date
    Jun 2014
    Location
    Ontario, Canada
    Posts
    12,737
    Your db is split into front and back ends, I hope. IMO, not necessary to back up be so often if you're worried mainly about losing objects in the fe (such as forms, reports etc.).
    The more we hear silence, the more we begin to think about our value in this universe.
    Paraphrase of Professor Brian Cox.

  6. #21
    Mac R is offline Advanced Beginner
    Windows 7 64bit Access 2013 64bit
    Join Date
    May 2022
    Location
    Maine, USA
    Posts
    39
    Not split yet, but absolutely will be. I usually don't do that until real close to the end of development. But it absolutely happens!

  7. #22
    Micron is offline Virtually Inert Person
    Windows 10 Access 2016
    Join Date
    Jun 2014
    Location
    Ontario, Canada
    Posts
    12,737
    Hmmm. Risky? Can't think of a reason not to do so - even if you have to open the be to tweak or add a table. If you corrupt the entire db you can lose a lot more than just a form, and that is more likely to happen when altering design.
    The more we hear silence, the more we begin to think about our value in this universe.
    Paraphrase of Professor Brian Cox.

  8. #23
    Mac R is offline Advanced Beginner
    Windows 7 64bit Access 2013 64bit
    Join Date
    May 2022
    Location
    Maine, USA
    Posts
    39
    Point well taken. Thanks.

  9. #24
    Mac R is offline Advanced Beginner
    Windows 7 64bit Access 2013 64bit
    Join Date
    May 2022
    Location
    Maine, USA
    Posts
    39
    Done. Is there a systemic way within the FE to auto back up the BE say each time it's opened, and/or on demand?

  10. #25
    Join Date
    Jan 2017
    Location
    Swansea,South Wales,UK
    Posts
    4,861
    I used to use this from the switchboard

    HTH
    Code:
    Function CreateBackupFE()
    ' Have to do it this way as Switchboard does not allow parameters.
    CreateBackup ("FE")
    End Function
    Function CreateBackupBE()
    ' Have to do it this way as Switchboard does not allow parameters.
    CreateBackup ("BE")
    End Function
    
    Sub CreateBackup(Optional strDBType As String)
        Dim strDBpath As String, ext As String, tmp As String
        Dim strPath As String, strBackupPath As String, strDB As String
        
        
        'tmp = CurrentDb.Name    'or maybe this should be the name of your BE
        'strDBType = "FE"
        strDBpath = GetAccessBE_PathFilename("tblUser")
        strPath = Left(strDBpath, InStrRev(strDBpath, "\"))
        strBackupPath = strPath & "Backup\"
        
        'Will now backup front and back end database
        If strDBType = "FE" Then
            strDBpath = CurrentDb.Name
        End If
        strDB = Right(strDBpath, Len(strDBpath) - InStrRev(strDBpath, "\"))
        
        With CreateObject("Scripting.FileSystemObject")
            'ext = "." & .GetExtensionName(tmp)
            tmp = strBackupPath & Format(Now(), "yyyymmdd_hhnnss") & "_" & strDB
            .CopyFile strDBpath, tmp
        End With
        MsgBox strDBType & " Database saved as " & tmp
        
        
    End Sub
    
    Function GetAccessBE_PathFilename(pTableName As String) As String
    'strive4peace
    
    
       ' RETURN
       '  the file path and file name of the BE database
       '  "" if the table is not linked
       
       On Error GoTo Proc_Err
       
       Dim db As DAO.Database _
          , tdf As DAO.TableDef
       
       GetAccessBE_PathFilename = ""
       
       Set db = CurrentDb
       Set tdf = db.TableDefs(pTableName)
       
       If Len(tdf.Connect) = 0 Then
          GoTo Proc_Exit
       End If
       
       ' look at Connect string - Database Type is the first thing specified
       ' if the BE is Access
       If InStr(tdf.Connect, ";DATABASE=") <> 1 Then
          GoTo Proc_Exit
       End If
       
       GetAccessBE_PathFilename = Mid(tdf.Connect, 11)
        
    Proc_Exit:
       On Error Resume Next
       Set tdf = Nothing
       Set db = Nothing
       Exit Function
      
    Proc_Err:
       MsgBox Err.Description, , _
            "ERROR " & Err.Number _
            & "   GetAccessBE_PathFilename"
    
    
       Resume Proc_Exit
       Resume
                 
    End Function
    Please use # icon on toolbar when posting code snippets.
    Cross Posting: https://www.excelguru.ca/content.php?184
    Debugging Access: https://www.youtube.com/results?sear...bug+access+vba

  11. #26
    Mac R is offline Advanced Beginner
    Windows 7 64bit Access 2013 64bit
    Join Date
    May 2022
    Location
    Maine, USA
    Posts
    39
    Thanks! Much Appreciated!

Page 2 of 2 FirstFirst 12
Please reply to this thread with any new information or opinions.

Similar Threads

  1. Recover deleted table in MS Access 2013
    By metsmaniac in forum Access
    Replies: 1
    Last Post: 10-10-2017, 12:44 PM
  2. Recover a seemingly corrupted form
    By GraeagleBill in forum Forms
    Replies: 13
    Last Post: 08-21-2014, 06:40 PM
  3. delete query produce #deleted in all deleted values
    By learning_graccess in forum Queries
    Replies: 2
    Last Post: 03-31-2012, 07:20 AM
  4. Serious Access Error, How to Recover?
    By bigroo in forum Access
    Replies: 4
    Last Post: 02-04-2012, 03:35 PM
  5. recover database
    By jgales in forum Access
    Replies: 1
    Last Post: 10-28-2011, 08:53 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