Running Access Macros

kstoneman10

Member
Joined
Feb 20, 2010
Messages
11
Programming Experience
3-5
I've found coding to run a single MS Access database marco in VB.Net. I'm curious to know if there is a way to run successive macros in different databases, one right after another. My intent would be to open a database, run macro, close database, open new DB and then run new macro Right now my issue is my procedure opens the next database without finishing the first one.

ny direction is greatly appreciated.

Kevin
 
G'd Afternoon Kevin,
We would need to see your code to find out what you're doing. If i would need to do something like that, i would be more concern about the opening and closing process than the macro. if you name your macro autoexec it will run as soon as your db open. From there you can chain all what you need and close it. Another option is to set a form to open when your db open, do all what you need and close it.
If you are opening your mdb files from vb.net, the common approach is:
VB.NET:
Dim OpenDb As System.Diagnostics.Process.Start("c:\db1.mdb")

OpenDb.WaitForExit()
Console.writeline ("Db is closed")
OpenDb.ExitCode
OpenDb.Close

Good luck
 
Back
Top