vba MS Access 2003 不进入调试模式并忽略断点
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/1476138/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
MS Access 2003 does not enter into debug mode and ignores breakpoints
提问by Bogdan_Ch
I developed a small VBA procedure in MS Access 2003 module (just one public Sub) The database is locked for me only, nobody else has access to the file. My code works but there is a small bug I want to find and fix
我在 MS Access 2003 模块中开发了一个小的 VBA 程序(只有一个公共子) 数据库只为我锁定,没有其他人可以访问该文件。我的代码有效,但我想找到并修复一个小错误
I need to debug my VBA code. I put breakpoint at the first line of the procedure.
我需要调试我的 VBA 代码。我把断点放在程序的第一行。
However, when I run this code, it never stops at the breakpoint and never enters to debug mode. Seems like VBA debugger is not working or disabled. I was not able to find any option how it is possible to disable/enable VBA debugger, I supposed it should be always enabled. Now I can debug this code only with the help of putting a lot of message boxes, but it takes a lot of time...
但是,当我运行此代码时,它永远不会在断点处停止,也永远不会进入调试模式。似乎 VBA 调试器不工作或被禁用。我无法找到如何禁用/启用 VBA 调试器的任何选项,我认为它应该始终启用。现在只能靠放很多消息框的帮助才能调试这段代码,但是要花很多时间……
回答by Mitch Wheat
Please see:
请参见:
Enable the Use Special Access Keys startup option.
To do so, follow these steps:
- Open the database in which the breakpoint has been set.
- On the Tools Menu, click Startup.
- In the Startup dialog box, click to select the Use Special Access Keys check box.
- Click OK to close the Startup dialog box.
- Close and then reopen the database.
- Run the code that contains the breakpoint. Note that execution of the code pauses at the breakpoint, as you would expect.
启用使用特殊访问键启动选项。
为此,请按照下列步骤操作:
- 打开设置了断点的数据库。
- 在工具菜单上,单击启动。
- 在“启动”对话框中,单击以选中“使用特殊访问键”复选框。
- 单击“确定”关闭“启动”对话框。
- 关闭然后重新打开数据库。
- 运行包含断点的代码。请注意,正如您所期望的那样,代码的执行会在断点处暂停。
回答by RubberDuck
Office 2010 Steps to resolve:
Office 2010 解决步骤:
- File
- Options
- Current Database
- Make sure "Use Access Special" is checked.
- Close and reopen Database.
- 文件
- 选项
- 当前数据库
- 确保选中“Use Access Special”。
- 关闭并重新打开数据库。