Solved

Run Access Macro from VB/ADO

Posted on 2001-08-14
4
352 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

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

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…
Describes a method of obtaining an object variable to an already running instance of Microsoft Access so that it can be controlled via automation.
Using Microsoft Access, learn some simple rules for how to construct tables in a relational database. Split up all multi-value fields into single values: Split up fields that belong to other things into separate tables: Make sure that all record…
In Microsoft Access, learn the trick to repeating sub-report headings at the top of each page. The problem with sub-reports and headings: Add a dummy group to the sub report using the expression =1: Set the “Repeat Section” property of the dummy…

757 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

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now