#Name? error in unbound, calculated text field

razovsuki

Registered User.
Local time
Today, 22:38
Joined
Feb 17, 2015
Messages
17
Hi everyone,

I've tried to understand and fix this error for a while now, and while it seems I'm not the only one to have run into it, I couldn't find any solution online.

What I have is:
A form containing a subform (continuous). The subform's Record Source is a query. The subform contains a bunch of text fields, taking their value from fields from the query.
Now, the fields that use the query's field as their Control Source directly have no issue; the values get display correctly.
But the fields that use a calculated value do not. Instead, I get a "#Name?" error on them.
I've checked, my controls don't have the same name as the fields from the query. Funny thing is, I have another form which contains exactly the same thing (different subform and source query of course, but the structure is the same), and the calculated values work perfectly.
I'd like to be able to have things like:
Code:
=Format([DatePlannedDelivery],"d/mm/yyyy (ddd)")
to get "10/03/2015 (Tue)" in my field.
But even if I just put "=[DatePlannedDelivery]" as the Control Source, it doesn't work.:confused:

What am I doing wrong?

Thanks in advance for your help!

[EDIT]
I forgot: I did use the Expression Builder to create the expressions, and the fields from the query are properly listed. I also tried the fully qualified names for the field (e.g. "[q_TaskList]![DatePlannedDelivery]) but that did not work either.
 
Last edited:
Have you actually confirmed that DatePlannedDelivery is included in the underlying query? That error means that Access can't resolve that field against the ones available in the source, and you've already eliminated the most common cause (controls named the same as fields).
 
@Frothingslosh

Yep, the field is in the query all right.

The thing is, all the fields work if I assign them directly via the drop-down menu in the Control Source property. If I select DatePlannedDelivery in there, I do see the proper value in the control.
But, whenever I try to transform the Control Source into a calculated field (like "=[DatePlannedDelivery]", or even "=[q_TaskList]![DatePlannedDelivery]"), I get the error.
So I'm not quite sure what's wrong...
 
Update:

Tried creating a new, blank form with the same query as the source, put a single text box control and tried the calculated value, and it works...
So, does it mean it has something to do with my form?
I don't really want to have to recreate it... also, I'd like to know what's wrong and how to fix it legit, in case it happens again ;)
 
Hmm okay, fixed it.
I just made a copy of the subform, and without touching anything else, the values in that one appear correctly.
I'm glad I found a solution, but disappointed because I don't get why it's working now, doesn't make sense...

Anyway, if that even happens to you, just make a copy of the form and use that one!
 
Well, a brute-force workaround would be to drop it into a text box directly, have the textbox's Visible property set to false, and then have your unbound control pull the value from that textbox.

It would at least get you moving until you can find the real reason that your field reference isn't resolving. And I'm stumped there, it's almost always one of: Field not included/a control named the same as the field/field name spelled differently.

EDIT:
Hmm okay, fixed it.
I just made a copy of the subform, and without touching anything else, the values in that one appear correctly.
I'm glad I found a solution, but disappointed because I don't get why it's working now, doesn't make sense...

Anyway, if that even happens to you, just make a copy of the form and use that one!
Okay, that's just weird.
 

Users who are viewing this thread

Back
Top Bottom