Results 1 to 3 of 3
  1. #1
    Join Date
    Mar 2006
    Posts
    2

    Unanswered: Execute a macro in a MS Access Database in VB6

    I am working on a project that involves a print system. I need to know if its possible for me to execute a macro that is in an Access Database (Office 2003) using VB6.

  2. #2
    Join Date
    Jun 2004
    Location
    Arizona, USA
    Posts
    1,848
    Quote Originally Posted by tphommel
    I am working on a project that involves a print system. I need to know if its possible for me to execute a macro that is in an Access Database (Office 2003) using VB6.
    You should be able to do so. The whole arena of external apps controlling an instance of an office (or other) app is called Automation.

    Search this forum, or alternatively, check out an Inet sister site, http://www.xtremevbtalk.com, whose speciality is VB programming.
    Lou
    使大吃一惊
    "Lisa, in this house, we obey the laws of thermodynamics!" - Homer Simpson
    "I have my standards. They may be low, but I have them!" - Bette Middler
    "It's a book about a Spanish guy named Manual. You should read it." - Dilbert


  3. #3
    Join Date
    Mar 2006
    Posts
    2

    Solution

    Thanks, but I had just figured it out.. I used the following and it was so easy, I should have seen it.

    Set a = CreateObject("Access.Application")
    a.opencurrentdatabase (App.Path & "\db.mdb")
    a.docmd.RunMacro "Macro1"

Posting Permissions

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