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
    http://I.Am/DougSteele
    (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
    > http://I.Am/DougSteele
    > (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
    http://I.Am/DougSteele
    (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
    > > http://I.Am/DougSteele
    > > (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
    http://I.Am/DougSteele
    (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
    > http://I.Am/DougSteele
    > (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
    >> > http://I.Am/DougSteele
    >> > (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?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
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:
    706
    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,264
    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:
    18,806
    Richard Choate
    Jul 12, 2003
  4. 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:
    181
    Albert D. Kallal
    Sep 29, 2003
  5. Chris

    unable to add new dulplicate record, run time error 3426

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

Share This Page