Results 1 to 5 of 5

Sharepoint Sync After Working Offline

  1. #1
    Join Date
    Jun 2019
    Posts
    3

    Sharepoint Sync After Working Offline


    Hi, I am developing a split database which can be remotely accessed using SharePoint lists as the back-end.

    I like the feature where the database is cached so that it can continue to be used offline and then synchronized once connection to SharePoint is possible.

    From testing I’ve found that the offline changes do sync however when the ‘synchronize’ button is pressed all the open forms close and the user is left with a blank window.
    Is there a way to re-open forms after a synchronize? All controls such as the navigation pane and ribbon are hidden to make the front-end more locked down, so the only way to recover the forms is to shutdown the access front-end and re-load.

    Or maybe the synchronize after working offline can be done in a different way where the forms are not closed?

    Thanks

  2. #2
    Ajax is online now VIP
    Windows 10 Access 2010 32bit
    Join Date
    Mar 2015
    Posts
    7,041
    Is there a way to re-open forms after a synchronize?
    use the docmd.openform function.

    If you need to know which forms were open, loop through the forms collection before you start the syncronisation

    e.g.

    Code:
    dim s as string
    dim frm as form
    dim a() as string
    dim i as integer
    
    'one method
    Do While Forms.Count > 0
        s = "," & Forms(0).Name & s
        DoCmd.Close acForm, Forms(0).Name   'to make sure the form is closed
    Loop
    
    'another method to just record names
    'For Each frm In Forms
    '    s = "," & frm.Name & s
    'Next frm
    
    
    'sync code here
    
    a=split(s,",")
    for i=1 to ubound(a)
        docmd.openform a(i)
    next i

  3. #3
    Join Date
    Jun 2019
    Posts
    3
    Hi Ajax

    Thank you for your reply.

    Saving the open form is a good idea.

    What would be the best event to trigger this code?

    When the message bar synchronize button is clicked all the forms close leaving a blank screen.

    Many Thanks

  4. #4
    Ajax is online now VIP
    Windows 10 Access 2010 32bit
    Join Date
    Mar 2015
    Posts
    7,041
    regret I don't know - I presumed you had code for syncing. Best event would be a button on a form and have the code in a separate module

    You will need code to sync instead - see this link to get you started https://www.accessforums.net/showthread.php?t=44964

    otherwise google something like 'access vba to sync with sharepoint'

    looking at the code - looks like all forms need to be closed to be able to sync - otherwise there is a risk that a record will be locked in which case the sync would fail - hence the suggestion for putting the code in a module

  5. #5
    Join Date
    Jun 2019
    Posts
    3
    Yes sorry, I hadn't thought about doing the sync through vba.

    Thank you for the links, I will attempt now to complete the sync through vba on a button. I can disable the message bar and force the user to sync through a command button.

    Appreciate your help.

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

Similar Threads

  1. Replies: 0
    Last Post: 09-18-2017, 09:02 AM
  2. Open DB without Sync to SharePoint
    By Aidan74 in forum Access
    Replies: 0
    Last Post: 01-13-2017, 06:07 AM
  3. Sharepoint Linked List keeps going offline
    By AME in forum SharePoint
    Replies: 1
    Last Post: 11-17-2016, 12:26 PM
  4. Replies: 0
    Last Post: 08-28-2014, 12:45 PM
  5. VPN offline Access data sync?
    By Heatshiver in forum Import/Export Data
    Replies: 3
    Last Post: 07-31-2012, 11:20 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