Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people, just like you, are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
Solved

Run Access Macro from VB/ADO

Posted on 2001-08-14
4
362 Views
Last Modified: 2013-11-27
Can someone give me the Visual Basic code to run an Access '97 Macro through ADO?
0
Comment
Question by:Maxim10553
  • 2
  • 2
4 Comments
 
LVL 3

Expert Comment

by:Diveblue
ID: 6385919
You can't do it through ADO or DAO, you need to use OLE

Access.Application...etc
0
 
LVL 3

Author Comment

by:Maxim10553
ID: 6386615
can you give a link or examples?
0
 
LVL 3

Accepted Solution

by:
Diveblue earned 25 total points
ID: 6386816
set a reference to microsoft access in the project/references menu...then

Dim oAcc As New Access.Application

With oAcc
   .OpenCurrentDatabase "c:\mydb.mdb", False
   .DoCmd.RunMacro "macroname"
End With

set oAcc = nothing
0
 
LVL 3

Author Comment

by:Maxim10553
ID: 6388041
cool, ill give it a try
0

Featured Post

Enterprise Mobility and BYOD For Dummies

Like “For Dummies” books, you can read this in whatever order you choose and learn about mobility and BYOD; and how to put a competitive mobile infrastructure in place. Developed for SMBs and large enterprises alike, you will find helpful use cases, planning, and implementation.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Experts-Exchange is a great place to come for help with solutions for your database issues, and many problems are resolved within minutes of being posted.  Others take a little more time and effort and often providing a sample database is very helpf…
Since upgrading to Office 2013 or higher installing the Smart Indenter addin will fail. This article will explain how to install it so it will work regardless of the Office version installed.
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
Learn how to number pages in an Access report over each group. Activate two pass printing by referencing the pages property: Add code to the Page Footers OnFormat event to capture the pages as there occur for each group. Use the pages property to …

809 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question