Page 3 of 3 FirstFirst 123
Results 31 to 32 of 32
  1. #31
    gaker10 is offline Competent Performer
    Windows 7 64bit Access 2010 32bit
    Join Date
    Jun 2014
    Posts
    262
    So I guess my question is, can I compact the database from within the file via a button without using file paths?



    When I click this button, I want the following to happen in order:

    1. Delete everything from a specific table and it's form (refresh the form after the table data is deleted)
    2. Compact and Repair the database

    UPDATE:

    I created a button to do step 1, but it is my understanding that a C&R cannot be done while VBA code is being executed, so coding this action would not be possible. For now I suppose I will use the Database Tools command to C&R upon request.
    Last edited by gaker10; 07-09-2014 at 01:15 PM.

  2. #32
    June7's Avatar
    June7 is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,770
    Revisiting this code again and realized had to remove .MoveFirst line from the modified code in post 2 then it works perfectly. Not sure why it was in there.
    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.

Page 3 of 3 FirstFirst 123
Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 4
    Last Post: 07-03-2013, 10:02 AM
  2. delete multiple records at once
    By akrylik in forum Access
    Replies: 5
    Last Post: 04-22-2012, 08:13 AM
  3. Replies: 5
    Last Post: 01-24-2012, 06:19 PM
  4. Replies: 2
    Last Post: 01-24-2012, 02:16 PM
  5. Multiple Subform records
    By Lupson2011 in forum Access
    Replies: 2
    Last Post: 08-24-2011, 08:49 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