Unable to run acCmdCompactDatabase

Discussion in 'Microsoft Access Form Coding' started by Guest, Jan 12, 2006.

  1. Guest

    Guest Guest

    I want to automate the compact database process with VBA code
    DoCmd.RunCommand acCmdCompactDatabase. All I get is an error message telling
    me to run this function from the toolbar manually.

    How do I automate so it runs on closing the database?
     
    Guest, Jan 12, 2006
    #1
    1. Advertisements

  2. What version of Access are you using? All versions since Access 2000 allow
    you to set a Compact On Close property under Tools | Startup

    --
    Doug Steele, Microsoft Access MVP

    (no e-mails, please!)


    "Chase" <> wrote in message
    news:...
    > I want to automate the compact database process with VBA code
    > DoCmd.RunCommand acCmdCompactDatabase. All I get is an error message

    telling
    > me to run this function from the toolbar manually.
    >
    > How do I automate so it runs on closing the database?
     
    Douglas J Steele, Jan 12, 2006
    #2
    1. Advertisements

  3. Guest

    Dane Cooper Guest

    Douglas:

    I am running Access 2003, and this option isn't available under Tools |
    Startup. Am I missing something?

    Dane


    "Douglas J Steele" <NOSPAM_djsteele@NOSPAM_canada.com> wrote in message
    news:...
    > What version of Access are you using? All versions since Access 2000 allow
    > you to set a Compact On Close property under Tools | Startup
    >
    > --
    > Doug Steele, Microsoft Access MVP
    >
    > (no e-mails, please!)
    >
    >
    > "Chase" <> wrote in message
    > news:...
    >> I want to automate the compact database process with VBA code
    >> DoCmd.RunCommand acCmdCompactDatabase. All I get is an error message

    > telling
    >> me to run this function from the toolbar manually.
    >>
    >> How do I automate so it runs on closing the database?

    >
    >
     
    Dane Cooper, Feb 24, 2006
    #3
  4. Sorry, I only have Access 97 installed on this machine, so I can't
    double-check exactly where on the form it is. Have you looked under
    Advanced?

    --
    Doug Steele, Microsoft Access MVP

    (no e-mails, please!)


    "Dane Cooper" <> wrote in message
    news:...
    > Douglas:
    >
    > I am running Access 2003, and this option isn't available under Tools |
    > Startup. Am I missing something?
    >
    > Dane
    >
    >
    > "Douglas J Steele" <NOSPAM_djsteele@NOSPAM_canada.com> wrote in message
    > news:...
    > > What version of Access are you using? All versions since Access 2000

    allow
    > > you to set a Compact On Close property under Tools | Startup
    > >
    > > --
    > > Doug Steele, Microsoft Access MVP
    > >
    > > (no e-mails, please!)
    > >
    > >
    > > "Chase" <> wrote in message
    > > news:...
    > >> I want to automate the compact database process with VBA code
    > >> DoCmd.RunCommand acCmdCompactDatabase. All I get is an error message

    > > telling
    > >> me to run this function from the toolbar manually.
    > >>
    > >> How do I automate so it runs on closing the database?

    > >
    > >

    >
    >
     
    Douglas J Steele, Feb 24, 2006
    #4
  5. My fault. It's on the General tab under Tools | Options.

    Note that this is setting is for all databases, not just one.

    --
    Doug Steele, Microsoft Access MVP

    (no private e-mails, please)


    "Douglas J Steele" <NOSPAM_djsteele@NOSPAM_canada.com> wrote in message
    news:uzJtg$...
    > Sorry, I only have Access 97 installed on this machine, so I can't
    > double-check exactly where on the form it is. Have you looked under
    > Advanced?
    >
    > --
    > Doug Steele, Microsoft Access MVP
    >
    > (no e-mails, please!)
    >
    >
    > "Dane Cooper" <> wrote in message
    > news:...
    >> Douglas:
    >>
    >> I am running Access 2003, and this option isn't available under Tools |
    >> Startup. Am I missing something?
    >>
    >> Dane
    >>
    >>
    >> "Douglas J Steele" <NOSPAM_djsteele@NOSPAM_canada.com> wrote in message
    >> news:...
    >> > What version of Access are you using? All versions since Access 2000

    > allow
    >> > you to set a Compact On Close property under Tools | Startup
    >> >
    >> > --
    >> > Doug Steele, Microsoft Access MVP
    >> >
    >> > (no e-mails, please!)
    >> >
    >> >
    >> > "Chase" <> wrote in message
    >> > news:...
    >> >> I want to automate the compact database process with VBA code
    >> >> DoCmd.RunCommand acCmdCompactDatabase. All I get is an error message
    >> > telling
    >> >> me to run this function from the toolbar manually.
    >> >>
    >> >> How do I automate so it runs on closing the database?
    >> >
    >> >

    >>
    >>

    >
    >
     
    Douglas J. Steele, Feb 24, 2006
    #5
    1. Advertisements

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.
Similar Threads
  1. Jason Peterson

    Run subform function from Main form

    Jason Peterson, Jul 3, 2003, in forum: Microsoft Access Form Coding
    Replies:
    1
    Views:
    864
    Allen Browne
    Jul 3, 2003
  2. Richard Choate

    Re: Run Excel macro from Access?

    Richard Choate, Jul 11, 2003, in forum: Microsoft Access Form Coding
    Replies:
    0
    Views:
    5,611
    Richard Choate
    Jul 11, 2003
  3. Matthew Sullivan

    Re: Run Excel macro from Access?

    Matthew Sullivan, Jul 12, 2003, in forum: Microsoft Access Form Coding
    Replies:
    1
    Views:
    19,287
    Richard Choate
    Jul 12, 2003
  4. Tim

    Run Word's Macro from command button

    Tim, Jul 19, 2003, in forum: Microsoft Access Form Coding
    Replies:
    2
    Views:
    1,742
  5. Paul Overway

    Re: AllowBypassKey works but autoexec doesn't run

    Paul Overway, Jul 21, 2003, in forum: Microsoft Access Form Coding
    Replies:
    1
    Views:
    383
    Bonnie
    Jul 21, 2003
  6. Sullivan

    Getting Automation Error, when trying to run DCount

    Sullivan, Jul 28, 2003, in forum: Microsoft Access Form Coding
    Replies:
    0
    Views:
    294
    Sullivan
    Jul 28, 2003
  7. Vince

    Form -> Pull ID -> Run Query -> Run Report All in one click?

    Vince, Sep 29, 2003, in forum: Microsoft Access Form Coding
    Replies:
    1
    Views:
    296
    Albert D. Kallal
    Sep 29, 2003
  8. Chris

    unable to add new dulplicate record, run time error 3426

    Chris, Oct 15, 2003, in forum: Microsoft Access Form Coding
    Replies:
    5
    Views:
    619
Loading...