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

    Macro to delete and then append

    How can I create a Macro that will empty a table and then run a query that appends records to the same table?

  2. #2
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,521
    I would use VBA, but you can use RunQuery to run a delete query and then an append query.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  3. #3
    bb_ is offline Novice
    Windows 10 Access 2016
    Join Date
    Jul 2017
    Posts
    15
    if i use VBA do i have to add it to a button to a form for it to execute?

  4. #4
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,926
    How did you plan to run a macro - just by clicking it in the Navigation Pane?

    VBA procedures in a general module can be run from the VBA editor with the Run button.

    Are you building a multi-user db or is this just for you alone?
    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.

  5. #5
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,521
    I'll get out of the way.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  6. #6
    bb_ is offline Novice
    Windows 10 Access 2016
    Join Date
    Jul 2017
    Posts
    15
    multiuser- trying to make it easy for a colleague to update a linked list in sharepoint monthly. would like it to be a one click

  7. #7
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,926
    Then regardless if you use macro or VBA, should be a form for user interface.
    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. Replies: 1
    Last Post: 07-06-2015, 04:29 AM
  2. Append, Update or Delete?
    By Deggsy in forum Queries
    Replies: 11
    Last Post: 05-26-2015, 09:07 AM
  3. Replies: 1
    Last Post: 01-16-2013, 10:58 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