Results 1 to 3 of 3
  1. #1
    Join Date
    Jun 2004
    Location
    Singapore
    Posts
    28

    Question Unanswered: Compact Database Upon Exiting Database

    Hi experts out there,

    How can I compact my database upon exiting my database?
    I know the manual way which is to use "tools=>datbase utilities=>compact and repair database", but how can I use in maybe macro or modules?

    Regards,
    oks

  2. #2
    Join Date
    Jan 2004
    Location
    The Netherlands
    Posts
    421
    As far as i know you cant ...

    There is an option in the 2000 (or newer) version of Access you can turn on:
    Open the Access database or Access project that you want Microsoft Access to compact automatically.

    1) On the Tools menu, click Options.
    2) Click the General tab.
    3) Select the Compact On Close check box.

    You can try working with
    SendKeys "%TDC"
    Which basicaly does the same as doing it manually and is basicaly a pain.

    Greetz

  3. #3
    Join Date
    Apr 2004
    Location
    Kingsland, Georgia
    Posts
    231
    If you want to set it in a macro instead of doing it through code, you can choose RunCommand from the Action Menu in the macro designer, and then choose CompactDatabase from the command combo box (or type in CompactDatabase). I wouldn't recommend dong this unless only one person at a time will be using the database. Have a great day

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •