Results 1 to 2 of 2
  1. #1
    bb_ is offline Novice
    Windows 10 Access 2016
    Join Date
    Jul 2017
    Posts
    15

    VBA delete and append

    In my form I have a button essentially to update a Linked sharepoint list.. the "update" deletes all records from the list and then runs an append query to add the new records. this update should be performed once a month. However it runs very slow and it not responding when I click. It does perform the commands but takes a couple minutes. Any ideas for improvement
    here is the VBA:
    Private Sub Toggle1518_Click()
    Dim dbs As DAO.Database
    Dim strSQL As String

    Set dbs = CurrentDb()
    strSQL = "DELETE [Table].* from [Table]"


    dbs.Execute strSQL
    dbs.Execute "Append Table"



    End Sub

  2. #2
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,772
    Use a command button instead of toggle.

    Probably won't make a difference but DELETE does not have to reference fields because the entire record is deleted: DELETE FROM [table]

    Post the SQL of the INSERT action.
    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.

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

Similar Threads

  1. Macro to delete and then append
    By bb_ in forum Access
    Replies: 6
    Last Post: 08-07-2017, 01:02 PM
  2. Replies: 1
    Last Post: 07-06-2015, 04:29 AM
  3. Append, Update or Delete?
    By Deggsy in forum Queries
    Replies: 11
    Last Post: 05-26-2015, 09:07 AM
  4. Append/Delete Queries
    By donnan33 in forum Queries
    Replies: 3
    Last Post: 01-13-2012, 03:01 PM
  5. #Deleted issue with Delete/Append Query
    By WendyCha in forum Access
    Replies: 4
    Last Post: 08-05-2011, 08:34 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