我已阅读relevant historical material这与其他人遇到的问题不同。添加 DoEvents
没有任何效果。
第一个问题
RetVal = SysCmd(4, "Here's an Update!")
清除状态栏文本和仪表,而不是更新文本。我已经使用 ?SysCmd(4, "some text")
在子窗口和立即窗口中对此进行了测试。
第二个问题
更令人困惑的是,SysCmd(3)
和 SysCmd(5)
两者完全删除了状态栏、文本和仪表。 documentation 中描述了 SysCmd(3)
:
When the argument is 3, the progress meter is removed from the status bar.
对于 another page 上的 SysCmd(5)
:
When the action argument is 5, the status bar text set by the previous SysCmd() function is removed.
与这些描述相反,整个状态栏被删除。
我什至尝试过测试 the suggested sub from Microsoft :
Function StatusBar ()
Dim RetVal As Variant
RetVal = SysCmd(4, "The rain in Spain falls mainly ...")
MsgBox "Press OK when you are ready to finish!"
RetVal = SysCmd(5)
End Function
测试仅产生消息框。
其他一切都有效
据我所知,其他一切都正常。这些按预期工作:
RetVal = SysCmd(1, "Beginning Queries...", 10) 'adds the status bar
RetVal = SysCmd(2,1) 'moves the meter
添加常量名称(即 acSysCmdSetStatus
)在 Access 2010 中似乎没有任何效果(因为这是 Access VBA,而不是 VBS)。
最佳答案
我遇到的问题都是关于一个糟糕的误解。 SysCmd
方法执行 a lot of things这有点让人难以承受。
在 Access 的最底部,我们有状态栏。 左下角的文本是 Status Bar Text 。这是通过 acSysCmdSetStatus
(4
的值)和 acSysCmdClearStatus
(5
的值)控制的。
此文本不能与 Status Bar Progress Meter 同时使用,位于状态栏的右下角。它有自己的文本。
上面的误解是状态栏文本操作会更改状态栏进度表的文本。但他们没有。
有关 SysCmd
操作值的引用,请参阅 here .
关于ms-access - 对于某些操作值, Access SysCmd 功能无法按预期工作,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30643646/