#Name? Error

Neilbees

Registered User.
Local time
Today, 02:09
Joined
Oct 30, 2006
Messages
51
Hi

I hope someone can shed some light on this. I'm sure the answer is right in front of me. I have 2 IIf statements in unbound text boxes on a form. One works and the other produces a #Name? error. The 2 statements are

=IIf([1stProofActual] Is Not Null,"",DateDiff("d",Date(),[1stProofTarget])) - works fine.

=IIf([2ndProofActual] Is Not Null,"",DateDiff("d",Date(),[2ndProofTarget])) - #Name? error.

All the names are correct, the text boxes do not have names that conflict with anything else.

Help!
 
I thought you needed to check for null using something like:

=IIf(Not IsNull([1stProofActual]),"",DateDiff("d",Date(),[1stProofTarget]))

???
ken
 
Hi Ken

Just tried that and get the same error. It's the fact that the 2 expressions are the same but one works and the other doesn't that's driving me mad!
 
Are you sure there are any nulls in the first one?
 
All the names are correct, the text boxes do not have names that conflict with anything else.

Are you using the text box names or the field names (since you say that they are different)?
 
And also the check for null is

IsNull([FieldNameHere])


Not

[FieldNameHere] Is Null

When you are using this in a controlsource of a control.
 
Hi Bob -

I'm guessing the first one would error if there were any nulls in it just like the second one. Just a guess -

:)
ken
 
And also the check for null is

IsNull([FieldNameHere])


Not

[FieldNameHere] Is Null

When you are using this in a controlsource of a control.

I think Ken has all ready suggested that, but also I think both work in the situation quoted. The problem for us is that we do not have access to the database to check everything, I think the poster needs to attach his db.

Brian
 
Hello chaps. Thanks for all the interest!

I'm attaching the database in question (I'm at home on a mac at the moment so I hope it works). The really weird thing I've now discovered is that all textboxes work fine on some computers at work and on other computers (including mine) there is this error. So you might very well look at the database and think "all looks fine to me." I am completely bewildered.

The form in question is frmMaster.

Thanks again for taking a look.
 

Attachments

Hi. Apologies for bumping this thread back up but I'm hoping someone might be able to provide a solution.

If you have a look at the database I attached to the post above you'll see there are 2 columns of text boxes in frmMaster - RAG and Days 'till Target. These columns are made up of text boxes containing various date calculations. On most peoples PCs these calculations work fine. However, on some PCs the text boxes get #Name? errors in them. I've attached screenshots of the forms from different PCs.

Can anyone think of any reason why calculations should work on the majority of users PCs but get this error on others?
 

Attachments

  • correct.jpg
    correct.jpg
    48.7 KB · Views: 106
  • error.jpg
    error.jpg
    77.3 KB · Views: 110
Have you checked for MISSING References on the machines where it doesn't work?
 
Hi Bob, thanks for the reply.

Can you tell me where I'd look for missing references?
 
Go to a form in design view and click VIEW > CODE and then when that window opens go to TOOLS > REFERENCES and check to see if any of the references that are checked have the word MISSING in front of them. If so, uncheck it, close the dialog and close and reopen the database.
 
Nope, no missing references. And the checked items on the machines that the form works on seem to be the same as the checked items on the machines that the form doesn't work on!

Is there anything else that might be causing the errors?
 
I think I'm about all out of ideas. And of course, it works on my machine. I don't know, maybe you should try reinstalling Access/Office on one of the machines it doesn't work on. That's about my only suggestion left.
 

Users who are viewing this thread

Back
Top Bottom