MS Access RunCode 宏找不到我的程序 [英] MS Access RunCode Macro cannot find my procedure
问题描述
我只是发布这个,因为我无法在任何地方找到解决方案.我终于弄明白了.真的有点傻.
I'm only posting this since I wasn't able to find a solution anywhere. I finally figured it out. Kind of silly really.
在 Access 宏中使用 RunCode 属性时,我试图从我的全局模块运行 Sub.我收到错误消息您输入的表达式具有数据库无法找到的函数名称."我无法弄清楚是什么问题.我听从了在这个问题上发布的每个人的建议,主要是以下几点:
When using the RunCode property within an Access Macro, I was trying to run a Sub from my global module. I was getting the error "The expression you entered has a function name that database can't find." I couldn't figure out what the issue was. I followed the advice of everyone that posted on this issue, which was mostly the following:
- 在程序名末尾使用()
- 不要在过程名称前使用="
还是不行!
推荐答案
然后我仔细阅读了错误信息.它提到它找不到 FUNCTION 名称.显然,RunCode 属性特别需要一个函数"而不是一个子函数.所以,我只是将我的 Sub 更改为 Function,它运行良好!
THEN I read the error message carefully. It mentions that it could not find the FUNCTION name. Apparently, the RunCode property specifically requires a "Function" not a Sub. So, I simply changed my Sub to Function and it worked fine!
希望这会有所帮助.
这篇关于MS Access RunCode 宏找不到我的程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!