MS-Access调试监视值长度有限。

23

我正在使用 MS-Access 2010,试图查看 VBA 代码中断点处定义的变量。问题在于观察窗口中的值文本框大小是固定的。换句话说,如果值太长,则在 Watches 窗口中截断该值。

如何查看变量中的完整值?


5
你尝试在立即窗口中使用“Debug.Print variable_name_here”吗? - Grant
4
在即时窗口中,你可以简单地输入?变量名来查看变量的值。 - Santosh
1个回答

31

为此最好使用中间窗口。我经常使用SQL查询来进行这个操作。

要显示这个,请使用"视图-->中间窗口"(或Control+G)。

然后使用以下类似的语法:

debug.print "This is a really long stringThis is a really long stringThis is a really long stringThis is a really long stringThis is a really long stringThis is a really long stringThis is a really long stringThis is a really long stringThis is a really long stringThis is a really long stringThis is a really long stringThis is a really long stringThis is a really long stringThis is a really long stringThis is a really long stringThis is a really long stringThis is a really long stringThis is a really long stringThis is a really long stringThis is a really long stringThis is a really long stringThis is a really long stringThis is a really long stringThis is a really long stringThis is a really long stringThis is a really long stringThis is a really long stringThis is a really long stringThis is a really long string"

您可以在中间窗口中选择并复制/粘贴,或滚动查看整个变量。

请注意,中间窗口不会自动清除,但您可以选择所有内容并随时删除它。


对于那些不知道的人,这是“即时窗口”,至少在Access 2016中是这样。感谢您的提示! - Elliott Addi

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接