How to call (and execute) the DoCmd.RunCommand from outside MS-ACCESS 
Author Message
 How to call (and execute) the DoCmd.RunCommand from outside MS-ACCESS

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



Mon, 09 Aug 2004 01:29:09 GMT  
 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



Mon, 09 Aug 2004 11:33:30 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. DoCmd.RunCommand acCmdSaveRecord DoCmd.RunCommand acCmdSaveRecord

2. DoCmd.RunCommand equivelents in access 8

3. Calling a Function in an MS Access Class/Form/Module from an outside application

4. help with DoCmd.RunCommand acCmdNewObjectReport required??

5. DoCmd.RunCommand acCmdOpenDatabase

6. DoCmd.RunCommand acCmdSaveRecord

7. DoCmd.RunCommand acCmdSaveRecord does not update the form!

8. DoCmd.RunCommand acCmdCompactDatabase - causes error

9. DoCmd.RunCommand acCmdSaveRecord A2K

10. DoCmd.Runcommand

11. Docmd.runcommand unhide

12. DoCmd.RunCommand acCmdCompileAndSaveAllModules

 

 
Powered by phpBB® Forum Software