-
Hi Guys
I'm building a small app that will run various macros (for overnight reporting etc) from two or maybe three Access databases. I am then compacting each one ready for use next morning.
All the code for compacting is sorted, but can anyone tell me how to go about running a macro that is held within a database? I presume i need to open an instance in some way and then locate the individual macro object..........
Regards
Peter Gidden
-
SQL
Peter,
Why not perform the actions from VB instead of using the macros.
If your macros are running queries then use the SQL Code from the queries to run from VB.
Bob
-
I could do, but the macros already contain all the formatting and e-mail addresses.
I was hoping there might be a way of running the macros from within VB. That would also leave the management and configuration of the macros within each database, and just the late night running to my VB program.
-
Access References
Hey PetergUK,
You can add a reference to Access in VB under the Project/References... menu. Just select the Microsoft Access 8.0 Object Library, and then you should be able to do most things you can do in Access straight from VB. You can use the DoCmd.RunMacro method to run a macro.
I want to be able to print Access reports from within VB, and you can do that this way. However, nobody's been able to tell me you can do this on a machine that does not have Access (or Office at all) installed on it. Anyone? Will the install for the VB app put the necessary files onto a non-Access machine? Thanks.
-JoeyCode