WinBatch Tech Support Home

Database Search

If you can't find the information using the categories below, post a question over in our WinBatch Tech Support Forum.

TechHome

OLE with Access

Can't find the information you are looking for here? Then leave a message over on our WinBatch Tech Support Forum.

OLE with Access Example

Keywords: 	 OLE Access

Question:

We are trying to automate running an Access97 form and "pushing" a button. I have looked through the Winbatch Web site and the hard copy documentation for an example on how to do this. Does anybody have an example of using Winbatch to push a button on Access 97 form which they are willing to share?

Answer:

Here's how to start access and open a form, but can't push the button on it until you know it's name. Need Winbatch version 99A or newer...
	AccessDB = ObjectOpen("Access.Application")
	ADB = AccessDB.Application
	; make sure use full db path/name
	ADB.OpenCurrentDatabase ("c:\data\access\expert advisor reports.mdb")

	ADB.Visible = 1
	ADB.UserControl = 1

	ADBCmd = ADB.docmd
	ADBCmd.openform("CSD Surveys")

	ADB.closecurrentDatabase

	;' Close Access with the Quit method on the Application object
	ADB.Quit

	;' Release the object variable
	ObjectClose(AccessDB)
the above opens the form "CSD Surveys" in the specified dbase.

To click the button, you probably need something like...

	ADBCmd.Command11.click 
***after*** you open the form...

get rid of the ADB.Quit line and access will remain open and running on the desktop.


Article ID:   W13662
Filename:   Another OLE with Access Example.txt
File Created: 1999:04:15:16:55:32
Last Updated: 1999:04:15:16:55:32