Automate closing an Access 2003 database

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • peter1952
    New Member
    • Mar 2010
    • 3

    Automate closing an Access 2003 database

    I would like to automate closing an Access 2003 database at the end of running a macro. How can I do this?
  • kadghar
    Recognized Expert Top Contributor
    • Apr 2007
    • 1302

    #2
    if the VBA code is in access itself:

    application.clo se

    if you're using an ActiveX object from elsewhere (supose it's Obj1):

    set Obj1 = nothing

    that should do it.

    Comment

    • peter1952
      New Member
      • Mar 2010
      • 3

      #3
      Thanks, I get the following error dialog box
      ---------------------------
      Microsoft Visual Basic
      ---------------------------
      Compile error:

      Method or data member not found
      ---------------------------
      OK Help
      ---------------------------
      ?

      Comment

      • kadghar
        Recognized Expert Top Contributor
        • Apr 2007
        • 1302

        #4
        Sorry, my mistake. It should be something like

        application.qui t

        Comment

        • peter1952
          New Member
          • Mar 2010
          • 3

          #5
          Briliant, hat works.

          Thank You

          Comment

          Working...