Problem with Field in Report

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have recently gone to Access 2007 and it seems that things I used to be
able to do don't work as they used to. I am trying the following simple
string in the footing for "County" and I get the #Name? error: ="Total
Expenses for " & [County] & " County"

I am having several similar problems. I was even putting this with the
total amount in one field but when I started having problems I have
simplified it to the above.

This used to work. What am I doing wrong?

Thanks for your help.
 
Suggestions:

1. If you don't have a text box named County on the report, add one (bound
to the County field.) Sometimes the Access optimizer tries to be too smart
and doesn't fetch the field for the report if there is no control bound
directly to it.

2. Make sure the Name property of this text box is not the same as the name
of a field. For example, it must not be called County.
 
I have a field "[County]" in the header of the report. This was a combo box
and I changed it to a text box. After I changed it the problem field
appeared OK. But when I closed the database and then re-opened it and pulled
the report it had the #Name? again.

I have done this type thing hundreds of times before but I can't get it to
work. Do I need to re-install Access?

Allen Browne said:
Suggestions:

1. If you don't have a text box named County on the report, add one (bound
to the County field.) Sometimes the Access optimizer tries to be too smart
and doesn't fetch the field for the report if there is no control bound
directly to it.

2. Make sure the Name property of this text box is not the same as the name
of a field. For example, it must not be called County.

--
Allen Browne - Microsoft MVP. Perth, Western Australia

Reply to group, rather than allenbrowne at mvps dot org.

Don S. said:
I have recently gone to Access 2007 and it seems that things I used to be
able to do don't work as they used to. I am trying the following simple
string in the footing for "County" and I get the #Name? error: ="Total
Expenses for " & [County] & " County"

I am having several similar problems. I was even putting this with the
total amount in one field but when I started having problems I have
simplified it to the above.

This used to work. What am I doing wrong?

Thanks for your help.
 
When Access starts doing weird stuff like that, this could be a side-effect
of another problem. (That's assuming the change did get saved.)

Try this sequence (in order):

1. Uncheck the boxes under:
Tools | Options | General | Name AutoCorrect
In Access 2007, it's:
Office Button | Access Options | Current Database | Name AutoCorrect
Explanation of why:
http://allenbrowne.com/bug-03.html

2. Compact the database to get rid of this junk:
Tools | Database Utilities | Compact/Repair
or in Access 2007:
Office Button | Manage | Compact/Repair

3. Close Access. Make a backup copy of the file. Decompile the database by
entering something like this at the command prompt while Access is not
running. It is all one line, and include the quotes:
"c:\Program Files\Microsoft office\office\msaccess.exe" /decompile
"c:\MyPath\MyDatabase.mdb"

4. Open Access (holding down the Shift key if you have any startup code),
and compact again.

5. Open a code window.
Choose References from the Tools menu.
Uncheck any references you do not need.
For a list of the ones you typically need in your version of Access, see:
http://allenbrowne.com/ser-38.html

6. Still in the code window, choose Compile from the Debug menu.
Fix any errors, and repeat until it compiles okay.

At this point, you should have a database where the name-autocorrect errors
are gone, the indexes are repaired, inconsistencies between the text- and
compiled-versions of the code are fixed, reference ambiguities are resolved,
and the code syntax is compilable.

If it is still a problem, the next step would be to get Access to rebuild
the database for you. Follow the steps for the first symptom in this
article:
Recovering from Corruption
at:
http://allenbrowne.com/ser-47.html

--
Allen Browne - Microsoft MVP. Perth, Western Australia

Reply to group, rather than allenbrowne at mvps dot org.

Don S. said:
I have a field "[County]" in the header of the report. This was a combo
box
and I changed it to a text box. After I changed it the problem field
appeared OK. But when I closed the database and then re-opened it and
pulled
the report it had the #Name? again.

I have done this type thing hundreds of times before but I can't get it to
work. Do I need to re-install Access?

Allen Browne said:
Suggestions:

1. If you don't have a text box named County on the report, add one
(bound
to the County field.) Sometimes the Access optimizer tries to be too
smart
and doesn't fetch the field for the report if there is no control bound
directly to it.

2. Make sure the Name property of this text box is not the same as the
name
of a field. For example, it must not be called County.

Don S. said:
I have recently gone to Access 2007 and it seems that things I used to
be
able to do don't work as they used to. I am trying the following
simple
string in the footing for "County" and I get the #Name? error: ="Total
Expenses for " & [County] & " County"

I am having several similar problems. I was even putting this with the
total amount in one field but when I started having problems I have
simplified it to the above.

This used to work. What am I doing wrong?

Thanks for your help.
 
Back
Top