
How to call (and execute) the DoCmd.RunCommand from outside MS-ACCESS
The Access Commands are -Access-Commands- not DAO/JET commands.
set MyApp = CreateObject("Access.Application")
MyApp.OpenCurrentDatabase(strNameMDB)
MyApp.DoCmd.RunCommand 7
if you include a reference to the Access Automation object you
will get all the named constants like acCmdNewObjectClassModule
(david)
Quote:
> Dear readers,
> In MS-Access I can create a class module using VBA:
> DoCmd.RunCommand acCmdNewObjectClassModule
> Now I am in Visual Basic and I want to create a new class module in a MDB
> using VB.
> In other words how do I call Docmd.runcommand from outside MS-ACCESS?
> Set db = DBEngine.Workspaces(0).OpenDatabase(strNameMDB)
> db.????? ,,, DoCmd.RunCommand acCmdNewObjectClassModule
> Thanks
> Peter van den Hooff