Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How do I run a macro from VB

Status
Not open for further replies.

jjjjjjj

Programmer
Nov 17, 2000
7
US
Hi, I have created a macro in Access 97 which deletes records from the tables in my database and imports delimited text files. When I run the macro in Access everything works fine. However, I have been unsucessfull at creating an application to run the macro. Does anyone have any ideas on how I can do this? I have been trying to use DoCmd.RunMacro but it has not been working. It opens my database but just hangs there.
 
I thought that it may be easier to just run the macro that was already created in Access.
 
I thought that it may be easier to just run the macro that was already created in Access.
 
Try getting the application to run the command line
dbpath\myDb.mdb /x macroname
this is a standard access command line option that allows you to open your database and run any macro within it (effectively turning the macro into an autoexec macro on this loading of the db).
If you need any further details on it you can find it in access help under command-line options
I hope this helps,
Richard
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top