What is "#Name?" and why can't I find it in the Help file?

  • Thread starter Thread starter Michael West
  • Start date Start date
M

Michael West

I'm trying to get a form field to display
a text string concatenated with the value
of an autonumber field.

I keep getting "#Name?" displayed in the
field. Why?

And how am I supposed to look up something like
this in a Help file or knowledge base?
 
#Name either means that Access simply doesn't recognize a word, or can't
decide which instance of a word you mean. (Think of it as "Huh? What do you
mean by that?")

Example 1: mispelling a FieldName or Function in the ControlSource of a text
box can generate a #Name error.
Example 2: when you use a wizard to create a form, by default Access uses
the FieldName as the name *and* the ControlSource for the control. If you
don't need to change the ControlSource of those contols, everything is fine.
However, if you subsequently edit the ControlSource and try to use the
FieldName in a formula (like concatenation) then Access gets confused about
which of the two (Control or FieldName) you are referring to in your formula
and will generate a #Name error. Solution for this is to modify the name of
the control (change a textbox named MyField to txtMyField). This should fix
the problem, but double check the formula that was giving you a problem.
Sometimes Access "helps" you by changing all occurances of MyField to
txtMyField, and that may or may not be what you want.

HTH,
 
Hello!

I am not sure I can solve your problem, but if I put "# name" in the Answer
Wizard of Access XP, I find a number of results. Clicking on the first
result (Troubleshoot expressions, data display and formatting, and the field
list) reveals a link to the following: "#Error? or #Name? appears in a
control". There are some suggestions there... I've copied and pasted them
below...

Make sure that the field specified in the control's ControlSource property
hasn't been removed from the underlying table or other record source.
Check the spelling of the field name in the control's ControlSource
property.
If you specified an expression in the control's ControlSource property, make
sure that there is an equal sign preceding the expression.
Make sure that there are brackets around references in expressions to
control or field names that include spaces. For example, to subtract a
Shipped Date field from a Required Date field, enter the following
expression: =[Required Date]-[Shipped Date].
If you are using one of the built-in functions, make sure that you're using
the right number of arguments, that the arguments are in the right order,
and that you haven't left out any necessary punctuation. To determine the
correct syntax to use, see the Help topic for the function you're using.
If you are referring to another control, make sure that you're using the
correct syntax.
Make sure that there isn't a circular reference to a control. For example,
if you specify MyControl in the Name property of a control, and then type
=[A]++[MyControl] in the ControlSource property box for the control,
Microsoft Access can't process the expression.
Make sure that the Access file doesn't contain a missing reference to a
project or library by opening a module in Design view, and clicking
References on the Tools menu. Clear the check box next to any missing
references, and then set the references you want.
If the control is in a data access page and contains an expression that uses
a function, make sure that the function is available in a data access page.

HTH
Fred Boer
 
#Name is an error condition that indicates Access is having trouble
resolving the name of something.

Examples of what could cause this condition:
1. Name of the field in the Control Source is misspelled.

2. The Control Source is an expression that does not make sense, e.g.:
="Fred" "Jones"
instead of:
="Fred" & "Jones"

3. There is a clash of names. For example, if the Name of this text box is
the same as the name of a field, but it is bound to something else, Access
gets confused. Rename the text box to solve the problem. Other names that
cause problems include:
Name most objects in Access have a Name property;
Date reserved system word for today's date;
Section forms have a Section property.

If you have more than one calculated control showing #Name, it does not mean
they are all wrong. Once one fails, Access gives up calculating, and so the
others may also show #Name. This can make it harder to debug where the cause
of the problem lies.
 
It usually means that there is a name conflict.

To accurately answer your question, I need to know:

1 - The name of your text box

2 - Exactly what you've put in the control source

If I had to make a wild guess, I'd say that your text box is the same as the
field name.

Try changing the text box name by adding a "txt" tag to it.

Sco
 
Hi,
The #Name error comes up when the code you used and the
textbox name don't match or the textbox data field refers
to a data item that doesn't match the table. You might
have misspelled the data item in the table i.e. TwooTables
instead of TwoTables.

In the Knowledgebase articles I look up the Access
version and the just type #Name in the search. I look at
the Knowledgebase articles first and then come to the
forum. People can refer to their issue as anything so it
is better to look as general as possible and scroll :)
i.e. error messages

Have a good day,
Bandit
 
Back
Top