我有一个用于过滤列表框的文本框。文本框旁边有一个命令按钮。我在文本框中输入一些过滤数据,然后将鼠标移动到命令按钮并单击。文本框中的所有相应事件都会触发,但命令按钮的单击事件不会触发。
我在Windows 8虚拟机上运行Access 2013(Mac上的Parallels)。
这是正常活动吗?
以下是来自以下活动的事件跟踪: 在文本框中输入字符“farm”,然后单击搜索命令按钮。 注意 - 命令按钮没有事件触发。
mIndustryFind==> tbxSearchText_Enter
mIndustryFind==> tbxSearchText_GotFocus
mIndustryFind==> tbxSearchText_KeyDown
mIndustryFind==> tbxSearchText_KeyPress
mIndustryFind==> tbxSearchText_Change
mIndustryFind==> tbxSearchText_KeyUp
mIndustryFind==> tbxSearchText_KeyDown
mIndustryFind==> tbxSearchText_KeyPress
mIndustryFind==> tbxSearchText_Change
mIndustryFind==> tbxSearchText_KeyUp
mIndustryFind==> tbxSearchText_KeyDown
mIndustryFind==> tbxSearchText_KeyPress
mIndustryFind==> tbxSearchText_Change
mIndustryFind==> tbxSearchText_KeyUp
mIndustryFind==> tbxSearchText_KeyDown
mIndustryFind==> tbxSearchText_KeyPress
mIndustryFind==> tbxSearchText_Change
mIndustryFind==> tbxSearchText_KeyUp
mIndustryFind==> tbxSearchText_BeforeUpdate
mIndustryFind==> tbxSearchText_AfterUpdate
mIndustryFind==> tbxSearchText_Exit
mIndustryFind==> tbxSearchText_LostFocus
mIndustryFind==> tbxSearchText_MouseMove
答案 0 :(得分:1)
在表单的代码模块中注释掉现有的click事件过程。然后使用“设计视图”中的表单打开命令按钮的属性表,并单击On Click事件的省略号,以在表单的模块中创建新的过程存根。在该存根中添加一个简单的语句。
MsgBox "button clicked"
如果新程序有效,请将其正文替换为原始代码。
这个建议的原因是我偶尔会发现Access “丢失跟踪”事件程序 - 尽管它们存在于模块中,但它们在运行时无法被识别。我描述的步骤总是能够纠正这些问题。
然而,虽然你的情况听起来有些类似,但我完全不相信这是解释。这可能是一个长镜头,但不应该花太多钱来排除它。