Nz function - error "undefined function" (1 Viewer)

TraceSL

Registered User.
Local time
Today, 09:38
Joined
Sep 12, 2017
Messages
51
Hello
I have a shared Access 2016 database for reporting used by 10+ users. One user continues to receive and error with the Nz function specifically "undefined function NZ in expression." To correct the last time I removed the Nz function used other method.
Trying to understand why this error only occurs for one user?

Any clues?

Thanks for the help Trace:banghead:
 

theDBguy

I’m here to help
Staff member
Local time
Today, 06:38
Joined
Oct 29, 2018
Messages
21,454
Hi Trace. Do you know if the user's copy has any missing reference?
 

TraceSL

Registered User.
Local time
Today, 09:38
Joined
Sep 12, 2017
Messages
51
The users all use the same shared access container so I am not sure what reference you are referring to can you give me more details? TY
 

theDBguy

I’m here to help
Staff member
Local time
Today, 06:38
Joined
Oct 29, 2018
Messages
21,454
The users all use the same shared access container so I am not sure what reference you are referring to can you give me more details? TY
Hi. What do you mean by that? Are you saying you're database is not split into two files where the data is shared, but the users have their own copy of the forms on their machine?
 

Solo712

Registered User.
Local time
Today, 09:38
Joined
Oct 19, 2012
Messages
828
Hello
I have a shared Access 2016 database for reporting used by 10+ users. One user continues to receive and error with the Nz function specifically "undefined function NZ in expression." To correct the last time I removed the Nz function used other method.
Trying to understand why this error only occurs for one user?

Any clues?

Thanks for the help Trace:banghead:

Check if the user has the correct version of Microsoft Access xx.x Object Library.

Best,
Jiri
 

TraceSL

Registered User.
Local time
Today, 09:38
Joined
Sep 12, 2017
Messages
51
Hi. What do you mean by that? Are you saying you're database is not split into two files where the data is shared, but the users have their own copy of the forms on their machine?

The shared access container is the code base for reporting options, the backend (split) primary datasource is SQL database.

The access database is a reporting tool provided with a financial software package I have built out extensively.
 

gemma-the-husky

Super Moderator
Staff member
Local time
Today, 14:38
Joined
Sep 12, 2006
Messages
15,638
It sounds like a rogue references error. It's not nz that's the problem, but another reference is wrong, and you are likely to get other erroneous messages as a result.

TheDBGuy and others are querying how you make the dbs available to your users, as different users using different releases of access could be causing this issue. Also having multiple people sharing the same copy of a (front end) database is not recommended.
 

TraceSL

Registered User.
Local time
Today, 09:38
Joined
Sep 12, 2017
Messages
51
TY Jiri
Not quite sure how to do the object library on the users PC. Google it now but if you have info to help much appreciated :)
 

theDBguy

I’m here to help
Staff member
Local time
Today, 06:38
Joined
Oct 29, 2018
Messages
21,454
The shared access container is the code base for reporting options, the backend (split) primary datasource is SQL database.

The access database is a reporting tool provided with a financial software package I have built out extensively.
Right, no. Each individual user should have their own copy of this container with all the code in it. This ensures each individual experience is not affected by each other's environment.
 

Solo712

Registered User.
Local time
Today, 09:38
Joined
Oct 19, 2012
Messages
828
TY Jiri
Not quite sure how to do the object library on the users PC. Google it now but if you have info to help much appreciated :)

Get into the VBA editor on the user's machine. Then pick Tools>References on the menu. I assume each user has their own Front End. The Access Object Library should be for the version of Access on the machine( ie. 12.0 for Access 2007, 15.0 for Access 2010, 16.0 for Access 2013).

Best,
Jiri
 

The_Doc_Man

Immoderate Moderator
Staff member
Local time
Today, 08:38
Joined
Feb 28, 2001
Messages
27,142
First, Jiri's directions are good.

To add to Jiri's comments, note this fact: The references of which we speak are pointers to function, subroutine, symbol, and text libraries that define things for Access. So when you do what Jiri told you, you will see a complex dialog box with a list of names that often (but not always) include the word "Library" as part of their title. And sometimes the word "Object" as well. Can't hardly not recognize it once you see it.

The reference items being used by your app will have check-marks in the left column next to the item you are using, and this list is always sorted so that all checked items are at the time. The unchecked items are alphabetically sorted.

Things to look for: "Missing reference" will appear next to a name that is checked but for some reason that referenced library isn't available. This is also sometimes called a "broken reference." The error you are seeing is caused by broken references.

Why this happens? Several reasons!

1. An update from Microsoft has hosed the machine to tears. Rare but it happens. Since it is only on one machine, I'm disinclined to say that's your culprit.

2. (This applies because you are sharing the front end container.) The wrong version (an OLDER version) of Access is installed on the workstation assigned to the user having the problem. Access would automatically UPGRADE any old versions on a machine, so if the app was built on Ac2013 but run on Ac2016, it would upgrade to 2016 versions of the references. BUT the user whose machine is still on Ac2013 cannot then DOWNGRADE those references to match what is on his machine.

3. Corrupted registry entry - because references are stored in the registry even though the app includes a list of what it needs. So each machine is potentially different. It is rare to corrupt a registry entry these days - but it could happen.

4. Since you are actually sharing the FE file from a common folder, this can also be caused by temporary conflicts or permanent corruption of the FE. Usually caused by file locking issues.

Dave's comment (Gemma...) has to do with the way named function references are managed. Once VBA thinks there is something wrong with a particular reference list item, NOTHING will get past that item. But what happens is that the NEXT attempt to find an entry point (such as NZ) will ALSO fail in the specific case that the second entry point would have been satisfied by a later entry in the list than the failing one - because VBA can't get past that failing reference.
 

TraceSL

Registered User.
Local time
Today, 09:38
Joined
Sep 12, 2017
Messages
51
Great input. Ironically the user having issues is a new staff member with a new computer setup. Since her new setup she's had this issue when others have not. I find this fact to be very interesting.

Definitely something in her setup. I need to check the computer components as they relate to Access.

I'll dig into the actual object in Access first to see if there areas for improvement.

I can check her version of VBA and look at the object library.

Thanks for the details. Trace

First, Jiri's directions are good.

To add to Jiri's comments, note this fact: The references of which we speak are pointers to function, subroutine, symbol, and text libraries that define things for Access. So when you do what Jiri told you, you will see a complex dialog box with a list of names that often (but not always) include the word "Library" as part of their title. And sometimes the word "Object" as well. Can't hardly not recognize it once you see it.

The reference items being used by your app will have check-marks in the left column next to the item you are using, and this list is always sorted so that all checked items are at the time. The unchecked items are alphabetically sorted.

Things to look for: "Missing reference" will appear next to a name that is checked but for some reason that referenced library isn't available. This is also sometimes called a "broken reference." The error you are seeing is caused by broken references.

Why this happens? Several reasons!

1. An update from Microsoft has hosed the machine to tears. Rare but it happens. Since it is only on one machine, I'm disinclined to say that's your culprit.

2. (This applies because you are sharing the front end container.) The wrong version (an OLDER version) of Access is installed on the workstation assigned to the user having the problem. Access would automatically UPGRADE any old versions on a machine, so if the app was built on Ac2013 but run on Ac2016, it would upgrade to 2016 versions of the references. BUT the user whose machine is still on Ac2013 cannot then DOWNGRADE those references to match what is on his machine.

3. Corrupted registry entry - because references are stored in the registry even though the app includes a list of what it needs. So each machine is potentially different. It is rare to corrupt a registry entry these days - but it could happen.

4. Since you are actually sharing the FE file from a common folder, this can also be caused by temporary conflicts or permanent corruption of the FE. Usually caused by file locking issues.

Dave's comment (Gemma...) has to do with the way named function references are managed. Once VBA thinks there is something wrong with a particular reference list item, NOTHING will get past that item. But what happens is that the NEXT attempt to find an entry point (such as NZ) will ALSO fail in the specific case that the second entry point would have been satisfied by a later entry in the list than the failing one - because VBA can't get past that failing reference.
 

The_Doc_Man

Immoderate Moderator
Staff member
Local time
Today, 08:38
Joined
Feb 28, 2001
Messages
27,142
For a new user / new installation, the MOST likely problem is that some non-standard library is called out for the app AND that non-standard library is referenced in that list BEFORE (ahead of / higher than) the one that contains the basic Access math library. This USUALLY occurs because some option wasn't chosen on the Access installation OR the app uses some other library (like Word, Outlook, or Excel) and that other package was not installed on the new user's system.

However, there is another issue... check whether the new user has a 32-bit or a 64-bit version of Office installed (and by implication, users that are working OK probably have the opposite bit-ness).

To do this, open Access on a working machine and on the new machine. Don't even need to actually open an app file, though you could if you wanted. Just use the File option, then from the drop-down select About. The page that comes up will include a blurb that tells you explicitly which version AND which bit-ness of Access you are using.
 

TraceSL

Registered User.
Local time
Today, 09:38
Joined
Sep 12, 2017
Messages
51
TY DocMan

I believe you are right it's related to the initial install. I did check Access version including 64 bit option.

I am removing the Nz function from the builds. All other users are fine so I feel this best approach at this time. TY for help and feedback

For a new user / new installation, the MOST likely problem is that some non-standard library is called out for the app AND that non-standard library is referenced in that list BEFORE (ahead of / higher than) the one that contains the basic Access math library. This USUALLY occurs because some option wasn't chosen on the Access installation OR the app uses some other library (like Word, Outlook, or Excel) and that other package was not installed on the new user's system.

However, there is another issue... check whether the new user has a 32-bit or a 64-bit version of Office installed (and by implication, users that are working OK probably have the opposite bit-ness).

To do this, open Access on a working machine and on the new machine. Don't even need to actually open an app file, though you could if you wanted. Just use the File option, then from the drop-down select About. The page that comes up will include a blurb that tells you explicitly which version AND which bit-ness of Access you are using.
 

The_Doc_Man

Immoderate Moderator
Staff member
Local time
Today, 08:38
Joined
Feb 28, 2001
Messages
27,142
Concur with Dave... removing the code invocations to NZ merely means some other call will trip the same problem. The library that contains NZ contains dozens to hundreds of other function/subroutine entry points. If you don't figure out which library is causing the real problem, the problem will probably persist.
 

TraceSL

Registered User.
Local time
Today, 09:38
Joined
Sep 12, 2017
Messages
51
we prefer the 64 bit environment. when I drilled down on this error on this users computer I began to receive bogus errors on table links which I know are solid.
We uninstalled and reinstalled Access issue not resolved.

10+ other computers in this environment no others receiving this error
 

isladogs

MVP / VIP
Local time
Today, 14:38
Joined
Jan 14, 2017
Messages
18,209
Have you checked that API declarations have been converted to 64-bit?
One correction to an earlier post by Jiri. The Access version numbering is 14.0 for 2010, 15.0 for 2013 & 16.0 for 2016/2019/365
 

TraceSL

Registered User.
Local time
Today, 09:38
Joined
Sep 12, 2017
Messages
51
Thought you all might want to know the resolution to this item.

User had two different Office installs on her computer one running 32 bit the other 64 bit.

Once Access 32 bit was removed issue was resolved.

I totally should of caught this luckily the IT tech did.

Mystery solved.

Thanks to all for the help
Regards and happy friday;)
 

theDBguy

I’m here to help
Staff member
Local time
Today, 06:38
Joined
Oct 29, 2018
Messages
21,454
Thought you all might want to know the resolution to this item.

User had two different Office installs on her computer one running 32 bit the other 64 bit.

Once Access 32 bit was removed issue was resolved.

I totally should of caught this luckily the IT tech did.

Mystery solved.

Thanks to all for the help
Regards and happy friday;)
Hi. Congratulations! Glad to hear you got it sorted out. Good luck with your project.
 

Users who are viewing this thread

Top Bottom