tunkefer
May 18 2007, 07:43 AM
In another thread, the following code snip was offered as a way to open an external Access application in a way that its forms can be referenced:
Dim objAccess as Object
Set objAccess = CreateObject("Access.Application")
objAccess.OpenCurrentDatabase "C:\YourPath\YourDB.mdb"
objAccess.Visible = True
objAccess.Docmd.OpenForm "YourFormName"
In the OpenCurrentDatabase command, can a reference to Runtime Access be included? In other words, is the path string evaluated as a DOS command or only as a file reference?
LPurvis
May 18 2007, 08:11 AM
You launch Access in runtime mode - not a database file.
It's why you have it as an argument in the command line - which is passed to the MSAccess executable - not the file mdb.
Are you just wanting to launch an instance of an mdb in runtime mode?
Why do you want to?
Are you not running under a runtime installation?
tunkefer
May 18 2007, 11:37 AM
Yes, I want to launch an instance of an mdb in runtime mode. I am developing a set of applications that will be deployed in a mixed environment. That is, there are multiple users with varying versions of Access, from Access 98 thru 2003, so I install these applications with Access runtime.
In order to make sure my installed version of Access runtime is used to execute my application, I build a shortcut that specifies the installed Runtime software to be used. I want to do the same for a second application launched from the first and still retain a reference to it from the first application so I can manipulate a form in the second.
LPurvis
May 18 2007, 11:41 AM
Are you essentially meaning that a machine might have many different version of Access (97 to 2003) installed, all as part of a runtime installation?
Or there might be, say, a 97 retail install - but you've propagated 2003 runtime installs throughout - and you want to launch the 2003 version of Access?
(Or that there might be the retail and runtime mode available for a given version)?
tunkefer
May 18 2007, 11:51 AM
There might be, and probably is, a version of Access on the target PC but it could be any version. My installation package installs Runtime Access 2003. The target string of desktop shortcut the package installs specifies that the package-installed Runtime Access be used. The shortcut target string looks something like:
"C:Program Files\Microsoft Office\Office11\msaccess.exe /runtime C:\MyPath\MyMDB.mdb"
This works fine.
I want to able to launch the same application from another Access application with the same assurance that it will execute under my Runtime Access but I also want to be able to reference that instance from the first application so I can manipulate a form. In other words, can I use a similar string to the above in the OpenCurrentDatabase command?
LPurvis
May 18 2007, 12:05 PM
I know you keep focussing on the *runtime* version running, but is there a particular reason for this?
Is it not just a case of wanting an Access 2003 instance to run your database?
(Bearing in mind that the runtime is only a *mode* of Access - it's still all Access, the same executable).
tunkefer
May 18 2007, 12:13 PM
Yes it is a case of wanting an instance of Access 2003 to run the database. But in the code:
Dim objAccess as Object
Set objAccess = CreateObject("Access.Application")
it seems to me that if a different version of retail Access is already installed on the PC, I'm going to get that version of Access, not the Runtime Access 2003 that my installer package has installed. So I'm looking for a way to make sure I get an instance of Access 2003 to execute.
LPurvis
May 18 2007, 12:17 PM
You can specify the version in the CreateObject method
Set objAccess = CreateObject("Access.Application.11")
(For Access 2003 - which is version 11 of course :-)
tunkefer
May 18 2007, 12:18 PM
OK. Thanks.
LPurvis
May 18 2007, 12:21 PM
No probs - see how you get on with it.
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please
click here.