Can't find the information you are looking for here? Then leave a message over on our WinBatch Tech Support Forum.
Keywords: Named Arguments
I've got my Winbatch to start Access and open the correct database, but I can't get it to open a form or run a macro. I'm currently using DDE to send the macro commands. I'd prefer to use winbatch for OLE since VB is a little cumbersome.
Here's a sample VB program that works...
Private Sub Form_Load() Dim AccessDB As Object Set AccessDB = CreateObject("Access.Application") ' Make Excel visible through the Application object AccessDB.Application.Visible = True AccessDB.Application.UserControl = True AccessDB.Application.OpenCurrentDatabase ("c:\data\access\OMC Region EA.mdb") AccessDB.DoCmd.OpenForm "Daily" AccessDB.DoCmd.Close acForm, "Daily" AccessDB.DoCmd.RunMacro "CSD Daily" ' Close Access with the Quit method on the Application object AccessDB.Application.Quit ' Release the object variable Set AccessDB = Nothing Unload Form1 End SubHere's my Winbatch script...
MyDB = ObjectOpen("Access.Application") dbname = "c:\data\access\duty.mdb" ;MyDB.visible = 1 MyDB.visible = @true MyDB.usercontrol = 1 MyDB.OpenCurrentDatabase(dbname) MyDB.DoCmd.openform "Test" myform = MyDB.Forms(0) MyDB.DoCmd.openform myform myform = "Test" MyDB.DoCmd.openform myform,,,,, ;message("",myform) message("MS Access","Close Access") ;timedelay(3) ;ObjectClose(MyDB)I've also tried numerous variations on the openform method (as described previously) As always, thanks for your help...
MyCmd=MyDB.DoCmd MyCmd.openform("Test")
Article ID: W13664
Filename: OLE and Access.txt
File Created: 1999:04:15:16:55:32
Last Updated: 1999:04:15:16:55:32