vba 没有为每个控件或事件找到方法或数据成员

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/11760791/
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

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-11 17:07:47  来源:igfitidea点击:

Method or Data Member Not found for every control or event

vbams-accessaccess-vba

提问by Scotch

Got a weird problem. I was debugging some code for a form and everything was working as intended for the most part when suddenly I began to get a "Method or Data Member Not Found" for every event of my form. It's like my form suddenly does not recognize any of my controls or events. I have all of my methods properly closed and did not rename any controls.

遇到一个奇怪的问题。我正在调试表单的一些代码,一切都按预期工作,但突然间我开始为表单的每个事件获取“未找到方法或数据成员”。就像我的表单突然无法识别我的任何控件或事件。我已经正确关闭了所有方法,并且没有重命名任何控件。

Any ideas on what would be the root of "Method or Data Member Not Found" for every single control with an event?

关于事件的每个控件的“未找到方法或数据成员”的根源是什么的任何想法?

Thanks

谢谢

采纳答案by Scotch

Importing into a fresh database as talbright suggested gave me more descriptive error messages.

按照 talbright 的建议导入新数据库给了我更多描述性的错误消息。

A fresh import, compact&repair, and renaming of appropriate control fixed the problem from occuring. As Remou suggested, regular maintenance can help prevent these sorts of problems.

新的导入、压缩和修复以及适当控件的重命名解决了问题的发生。正如 Remou 建议的那样,定期维护可以帮助防止此类问题。

edit for future readers: This problem occurred while using a shared front end file. So don't do that if possible.

为未来读者编辑:使用共享前端文件时出现此问题。所以如果可能的话,不要这样做。

回答by SeanC

I've found that any MISSING:reference can make the simplest of code fail.

我发现任何MISSING:引用都可能使最简单的代码失败。

Check in the visual basic window

签入visual basic窗口

Menu Tools -> References

菜单工具 -> 参考

look down the checked refences to see if any are MISSING

查看检查的参考文献,看看是否有任何丢失

look down the checked refences to see if any are MISSING

查看检查的参考文献,看看是否有任何丢失