There appear to be a number of RunCommand constants that cannot be used from
code. For example Error 2046 seems to come up a lot. It gives a somewhat
misleading message.
The following are RunCommand constants that I cannot
get to work from code. The list only includes constants for which I have
made several attempts to get some working code. This has normally involved
trying to get it to work from events on a form or report and also adding to
menus or toolbars.
For some of the constants I have either found some work around or pointed to
how it may be solved.
This page is still being developed and if you know of any code or work
arounds for these constants then please let me know.
acCmdReferences
The References option is not available when you are running code. It is only available
in design time. There is a work around, you use a macro!!! However you cannot call the macro
from code, it has to run from a button event or possibly a menu item.
The following are the macro actions required to display the References dialog. Replace mdlMenu
with the name of one of your own modules. The Echo argument is just to stop the user seeing
the open module.
Action | Argument | Value |
Echo | Echo On: | No |
OpenModule | Module Name: | mdlMenu |
RunCommand | Command: | acCmdReferences |
Close | Object Type: | Module |
| Object Name: | mdlMenu |
Note: This option can not be used with the Runtime version of Access,
even if you use a macro. Thanks to Paolo for this information.