Share via

MS Access - #Name? Error

Anonymous
2014-11-12T15:15:36+00:00

Hello,

I'm having difficulty with a field on a form which calculates the # days pending by comparing the open_dt with the closed_dt. The calculation is performed with a module function and works perfectly for all other reports.

Each time I open the database and the form the #Name? error appears in the # days pending form field. The only way I can get the calculation field to work properly is to delete the field from the form and re-add it. However, as soon as I close and reopen the database the error appears again.

I'm using a split database. I added two fields to the backend database about the time this problem started to occur. The field names used in the calculation are the same, and as I mentioned before, all other reports using the same calculation work just fine.

Any advice would be appreciated.

Walt N

Microsoft 365 and Office | Access | For home | Windows

Locked Question. This question was migrated from the Microsoft Support Community. You can vote on whether it's helpful, but you can't add comments or replies or follow the question.

0 comments No comments

10 answers

Sort by: Most helpful
  1. Duane Hookom 26,820 Reputation points Volunteer Moderator
    2014-11-12T16:04:20+00:00

    Can you share the function, expression in the Control Source, name of the text box, sample values, and data types?

    Typically you will see the #Name? error if the name of the control is also the name of a field in the record source and the Control Source begins with "=".

    20+ people found this answer helpful.
    0 comments No comments
  2. Duane Hookom 26,820 Reputation points Volunteer Moderator
    2014-11-12T22:02:32+00:00

    As I stated previously:

    Typically you will see the #Name? error if the name of the control is also the name of a field in the record source and the Control Source begins with "=".

    You have a field name "Days Pending" and a control named "Days Pending". Also, your Control Source begins with "=". Try change the name of the control to "txtDaysPending".

    10+ people found this answer helpful.
    0 comments No comments
  3. Duane Hookom 26,820 Reputation points Volunteer Moderator
    2014-11-13T15:04:19+00:00

    Did you check to see if the changes stuck? This could be an issue with the "Name AutoCorrect Options" being on. I typically uncheck all of these options in  Access Options->Current Database.

    6 people found this answer helpful.
    0 comments No comments
  4. Anonymous
    2014-11-13T22:14:04+00:00

    Duane,

    I've done a few compact and repairs this week but the error persisted. I did not recompile the code for the module function.

    I went to a backup copy for the front-end database and relinked to the back-end using the Link Table Manager utility. Then I reworked the form by removing the unwanted fields and adding the new fields and edit lists.

    The form seems to be working again but I'm not sure why. 

    Fingers crossed for now.

    Thanks for your help,

    Walt N

    5 people found this answer helpful.
    0 comments No comments
  5. Anonymous
    2014-11-12T21:46:09+00:00

    Hey Duane,

    The function is one I found here running a module called WorkingDaysMod called WorkingDays2. It uses a table of holidays along with the opened date and closed date to compute the # days pending for each incident.

    The expression in the control source is: =WorkingDays2([Opened Date],NZ([Closed Date],Date()))

    The name field Text Box is: Days Pending 

    The name of the Control is: Days Pending

    The data type is a General Number             (samples 1,2,3,........)

    The label on the form field is:  # Days Pending

    I have a field in my table called "Days Pending" which at the outset I wanted to use to store the value. Since then I've learned it is better to do the computation when the report is generated rather than attempt to store it. 

    Thanks again for your help.

    Sincerely,

    Walt N

    5 people found this answer helpful.
    0 comments No comments