Results 1 to 4 of 4
  1. #1
    GraeagleBill's Avatar
    GraeagleBill is offline Experienced Old Geezer
    Windows 10 Access 2013 32bit
    Join Date
    Feb 2011
    Posts
    1,919

    Use table a bit like a scratch pad

    I've never seen a single statement that would completely clear an existing table in preparation for a fresh loading. What's the simplest way to accomplish such a procedure? Delete the table and then TableDef a new one?

  2. #2
    John_G is offline VIP
    Windows 7 32bit Access 2010 32bit
    Join Date
    Oct 2011
    Location
    Ottawa, ON (area)
    Posts
    2,615
    currentdb.execute "Delete * from tablename" will accomplish that for you.

  3. #3
    Gicu's Avatar
    Gicu is offline VIP
    Windows 8 Access 2013
    Join Date
    Jul 2015
    Location
    Kelowna, BC, Canada
    Posts
    4,101
    sometimes if you have lots of records the delete will take awhile. I have been using something like this:


    DoCmd.TransferDatabase acExport, "Microsoft Access", CurrentDb().Name, acTable, "TableToCopy", "TableToCreate", False 'this will create a new empty table- I use the suffix "_EMPTY" for the tabletocreate


    Then you DoCmd.DeleteObject acTable, "TableToCopy"
    Finally DoCmd.Rename "TableToCopy", acTable, "TableToCreate"

    Cheers,
    Vlad

  4. #4
    GraeagleBill's Avatar
    GraeagleBill is offline Experienced Old Geezer
    Windows 10 Access 2013 32bit
    Join Date
    Feb 2011
    Posts
    1,919
    Very small amount of records so delete will go plenty fast enough.
    Thanks,
    Bill

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

Similar Threads

  1. Create a Insert into From scratch for newbie
    By ryoka012 in forum Access
    Replies: 8
    Last Post: 04-07-2014, 04:17 PM
  2. Questionnaire DB from Scratch
    By jomby in forum Database Design
    Replies: 4
    Last Post: 05-18-2012, 01:20 AM
  3. Building a database from scratch
    By kookiethekat in forum Access
    Replies: 1
    Last Post: 01-20-2011, 06:35 AM
  4. Help w/ DB from scratch.
    By ellixer in forum Database Design
    Replies: 9
    Last Post: 11-30-2010, 10:44 AM
  5. Access Novice - Looking to learn from scratch.
    By Javaman in forum Database Design
    Replies: 1
    Last Post: 03-13-2010, 08:53 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