Results 1 to 3 of 3
  1. #1
    Lou_Reed is offline VIP
    Windows 7 64bit Access 2010 64bit
    Join Date
    Mar 2015
    Posts
    1,664

    Emptying a database of data

    Is there way to empty a an MS Access 2010 database of its contents in one easy keystroke?


    I am trying to check my database and I think that an easy way to do that is by starting over
    is repopulating it wit data.

    Any help appreciated. Thanks in advance.


    Respectfully,



    Lou_Reed

  2. #2
    JoeM is offline VIP
    Windows XP Access 2007
    Join Date
    Jun 2012
    Posts
    3,904
    You can create a Macro that will delete each of your data tables.
    Basically, you would use the "RunSQL" Action, with a command like this:
    Code:
    DELETE [TableName].* FROM [TableName];
    You would need one of those actions for each table you have.
    I would also recommend adding a "SetWarnings" action at the top set to "No", and one at the bottom set to "Yes". This would suppress all those warning about deleting the records in each table.

    If you are not opposed to VBA, you could do all tables at once with VBA code, like the code shown here: http://stackoverflow.com/questions/6...tables-at-once

  3. #3
    CJ_London is offline VIP
    Windows 8 Access 2010 32bit
    Join Date
    Mar 2015
    Posts
    11,430
    assuming you have your tables in a backend (and if not, this is a good time to start), create a new blank db and import all the tables to create that backend - under options, choose 'definition only'. Not one keystroke, but only a few clicks of the mouse and a lot quicker to run than deleting contents

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

Similar Threads

  1. Replies: 11
    Last Post: 08-06-2014, 10:10 AM
  2. delete
    By steelcurtain11 in forum Access
    Replies: 1
    Last Post: 03-12-2013, 11:57 PM
  3. Getting the Previous Data from the database.
    By rjbautista20 in forum Programming
    Replies: 2
    Last Post: 09-17-2012, 10:14 PM
  4. Getting a database without the data
    By GRB in forum Access
    Replies: 5
    Last Post: 01-09-2011, 07:50 AM
  5. EDI data into Access database
    By cazper67 in forum Access
    Replies: 2
    Last Post: 07-24-2010, 05:57 PM

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