问题描述
我尝试了简单的查询:
select Year ( #5/1/1990# );
它显示错误对话框:
此外,当我以Date()
的形式使用它时,它会显示#NAME
.我在Access中使用表达式生成器添加了它.我在做什么错了?
Also, when I use Date()
in the form it shows #NAME
. I added it with expression builder in Access. What am I doing wrong?
推荐答案
项目中引用的库存在问题.
There is a problem with the referenced libraries in your project.
打开VBA编辑器(功能区中的数据库工具"->"Visual Basic"),然后转到菜单工具"->参考".检查是否有任何标有"missing"的库.重新安装这些库或通过删除它们并使用浏览"按钮添加它们来更改它们的路径.
Open the VBA Editor ("Database Tools"->"Visual Basic" in the Ribbon) there go to the menu "Tools"->"References". Check if there is any library marked with "missing". Reinstall those libraries or change their path by removing them and adding them using the "Browse" button.
通常,您应该删除项目中实际上没有使用的任何库.
Generally you should remove any library you do not actually use in your project.
如果这样做没有帮助,请删除所有库(如果可能,某些库是内置库且无法删除),然后再次添加它们.
If that does not help, remove all the libraries (if possible, some are built-in and can not be removed) and add them again.
更改库后,使用菜单调试"->编译您的项目".如果VBA代码中的库存在明显问题,则应该显示错误消息.但是,它将不会检测到查询或窗体控件中使用的表达式的任何问题.
After changing the libraries use the menu "Debug"->"Compile yourProject". That should show error messages if there are obvious problems with the libraries in the VBA code. It will however not detect any problems with expressions used in queries or Form-controls.
如果以上步骤均不能解决问题.您可以创建一个新的Access数据库,然后将所有旧数据库中的对象导入到新数据库中,而无需使用功能区中的外部数据"->"Access".
If none of the steps above helped fixing the problem. You could create a new Access database and then import all the objects from your old database into the new one unsing "External Data"->"Access" in the Ribbon.
这篇关于无法识别诸如Year()和Date()之类的内置函数的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!