Page 2 of 2 FirstFirst 12
Results 16 to 24 of 24

Another way to Auto Update of Front End

  1. #16
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    48,232
    Yes and yes, if IT manager sets open permissions on the destination folder.

    Local table or label on form, doesn't matter, same principle. Code compares value in frontend against value in backend table.
    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.

  2. #17
    MagicMarkerz is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Mar 2014
    Posts
    7
    All right. I think I've mostly got what I need, then. I just need to check one last thing with you. The text in green is the change I already know I need to make; the text in red, I'm assuming that's the directory the file is located in, correct? C:\Program\etc\etc?
    Code:
    If Me.tbxVersion <> Me.lblVersion.Caption Then'copy Access file
    CreateObject("Scripting.FileSystemObject").CopyFile _
        gstrBasePath & "Program\Install\MaterialsDatabase.accdb", "p:\", True
    'allow enough time for file to completely copy before opening
    Dim Start As Double
    Start = Timer
    While Timer < Start + 3
        DoEvents
    Wend
    'load new version - SysCmd function gets the Access executable file path
    'Shell function requires literal quote marks in the target filename string argument, hence the quadrupled quote marks
    Shell SysCmd(acSysCmdAccessDir) & "MSAccess.exe " & """" & CurrentProject.FullName & """", vbNormalFocus
    'close current file
    DoCmd.Quit
    End If

  3. #18
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    48,232
    Don't see any green text.

    Yes for the red. That's the location of the new version that needs to be copied. Program is a folder under the gstrBasePath, which is a global variable I declare in a general module. It is set to a string that uses UNC pathing, like:

    \\servername\folderpath\

    If you use a drive letter pathing, user must have that drive mapped with Windows on their computer. Does everyone have a drive p:\ mapped?
    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.

  4. #19
    MagicMarkerz is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Mar 2014
    Posts
    7
    Yes, everyone that will need to have access to this file will have the P:\ drive mapped. From what I remember of the command you're using, the C:\ (in yours) or P:\ (in mine) drive is the location where the file will be copied *to*, correct?

    As for the red, instead of defining a variable, could I just input the entire file path? \\Servername\filepath\filename? I might regret this down the road, but at the moment I don't have any need to declare the filepath as a global variable.

  5. #20
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    48,232
    Yes, of course you can code the entire path directly instead of concatenating variable.

    You do understand the destination must be different for every user? Each user needs to open and run their own copy of the frontend, not a shared frontend. Is P:\ on the local workstation or on the central file server? C:\ works because that is saving the file to local hard drive, not to a common location on the server.
    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.

  6. #21
    MagicMarkerz is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Mar 2014
    Posts
    7
    That's exactly why I chose the P:\ drive in this case. It's the same location for everybody that's different: it's a "personal" drive. So the network mapping is the exact same for everyone, it just puts them into their own area. I'm hoping that explanation makes as much sense as it does in my head. I'm going to be testing this out momentarily, so fingers crossed.

  7. #22
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    48,232
    I tried that and ran into the IT permissions issue. Could not programmatically copy file into personal folder.
    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.

  8. #23
    MagicMarkerz is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Mar 2014
    Posts
    7
    Just wanted to poke in and let you know that it worked almost perfectly.

    They're getting non-exclusive access errors when the update functionality kicks in, but I suspect that's due to needing to increase the delay that you have built in to it already. But your thoughts/feedback would be appreciated on that one!

  9. #24
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    48,232
    Don't remember ever having that issue. Try increasing the delay and see what happens.
    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.

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

Similar Threads

  1. Replies: 4
    Last Post: 01-09-2013, 05:26 PM
  2. update front end mde
    By slimjen in forum Access
    Replies: 2
    Last Post: 10-31-2011, 11:37 AM
  3. Front End Update Problem
    By Randy in forum Access
    Replies: 2
    Last Post: 02-12-2011, 09:46 PM
  4. auto link between front db and back db
    By ahmed in forum Programming
    Replies: 3
    Last Post: 08-09-2010, 07:10 AM
  5. Auto Update Forms
    By Vikki in forum Forms
    Replies: 1
    Last Post: 02-09-2010, 10:51 AM

Tags for this Thread

Posting Permissions

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