Access to built-in functions like Year () and Date () is not recognized

I tried a simple query:

select Year ( #5/1/1990# );

An error dialog will appear:

Function "Year" is not defined in expression

Also, when I use Date()

in a form, it shows #NAME

. I added it using an Expression in Access. What am I doing wrong?

+3


source to share


2 answers


There is a problem with referenced libraries in your projects.

Open the VBA editor (Database Tools โ†’ Visual Basic in the Ribbon), go to Tools โ†’ Links. Check to see if there is a library marked "missing". Reinstall these libraries or change their path by removing and adding them using the Browse button.

Generally, you should remove any library that you are not actually using in your project.



If that doesn't help, remove all libraries (if possible, some of them are built-in and cannot be removed) and add them again.

After modifying the libraries, use the "Debug" โ†’ "Compile yourProject" menu. This should show error messages if there are obvious library problems in the VBA code. However, it will not find any problems with expressions used in queries or control forms.

If none of the steps above helped fix the problem. You can create a new Access database and then import all objects from the old database into the new one without using External Data โ†’ Access in the ribbon.

+2


source


I had a similar problem where all inline functionality stopped working on the database. All links are checked ok.



Incidentally, this is solved by renaming the database so that I can restore the old version. When reopening the renamed database, I was asked to make it trusted. After that, the built-in functions started working again.

-1


source







All Articles