Solved

Run Access Macro from VB/ADO

Posted on 2001-08-14
4
364 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
[X]
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
  • 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

In earlier versions of Windows (XP and before), you could drag a database to the taskbar, where it would appear as a taskbar icon to open that database.  This article shows how to recreate this functionality in Windows 7 through 10.
This article describes a method of delivering Word templates for use in merging Access data to Word documents, that requires no computer knowledge on the part of the recipient -- the templates are saved in table fields, and are extracted and install…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…

756 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