'starting access with parameters doesn't work if an other database is opened
hopefully there is anybody who can solve my problem. I would start an access db using a link (with /x macro or /cmd para) at the desktop. All is fine if access isn't running but if access is open (working at two database projects) neither /x macro nor /cmd para will work.
I've tried also /runtime with /x and /cmd but no change against the above.
autoexec macro will work fine
so many thanks in advance ralph
Solution 1:[1]
To make this work, the link (command line) must include the path to msaccess.exe, e.g.
"C:\Program Files (x86)\Microsoft Office\Office14\MSACCESS.EXE" D:\Work\myDb.accdb /cmd foo
It probably is sufficient to use
MSACCESS.EXE D:\Work\myDb.accdb /cmd foo
because MSACCESS.EXE is registered in HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths
Solution 2:[2]
I just encountered this problem too, and I found that apart from including the path to msaccess.exe there is also another way to make it work.
That is to change the file extension of the access file you open with command line parameters from .accdb to .accdr (which is a way to simulate access runtime). If you do that then the command line parameters will be read properly even if there is already another access file open.
(You must of course change the extension both on the real file and the referring text inside the batch file.)
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | Andre |
| Solution 2 | Magnus |
