Solved

Run Access Macro from VB/ADO

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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

When designing a form there are several BorderStyles to choose from, all of which can be classified as either 'Fixed' or 'Sizable' and I'd guess that 'Fixed Single' or one of the other fixed types is the most popular choice. I assume it's the most p…
In a multiple monitor setup, if you don't want to use AutoCenter to position your popup forms, you have a problem: where will they appear?  Sometimes you may have an additional problem: where the devil did they go?  If you last had a popup form open…
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 …
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

910 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

20 Experts available now in Live!

Get 1:1 Help Now