I don't know about macros but you can execute SQL statements like queries. DAO has the Querydefs collection to allow the use of queries in an Access DB. ADO, which is better, can execute the equivalent SQL statewments.
dim conn as connection
dim rs as recordset
dim strConnect as string
I just went through the process of trying to run a function in an Access module from VB using ADO. Unfortunately it looks like it can't be done. Queries are ok though.
Mike When you call out for help in the darkness, and you hear a voice in return, you're probably just talking to yourself again!
To run an Access Macro with-in a VB program you will need to add a reference to the Microsoft Access Object library, or just create the object.
Once done, you can use an object variable on it and then execute the DoCmd method with-in VB.
While this works fine, you may not distribute the Access object with-out the proper license (wouldn't work anyways if ACCESS was not on the client pc).
You may however reference the object with-in your project, and, if the client PC has a copy of ACCESS on it, then there is no problem....if not, then you will not be able to do what you want.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.