Len([Name]) doesn't work in access report

K

krassi69

I have field [Name] with length 200 in access report. When I try to calculate
the number of symbols in the field with Len([Name]) commnad, every time I
receive 4. I tried with different data types for [Name] - nvarchar, varchar,
char, nchar, text, ntext, but every time I receive 4 symbols. I can calculate
the number of symbols with Len command for other fields in the report with
data type int, real. I use in the field [Name] english and cyrillic letters
and numbers. Please help me !
 
M

MA

krassi69 said:
I have field [Name] with length 200 in access report. When I try to
calculate the number of symbols in the field with Len([Name])
commnad, every time I receive 4. I tried with different data types
for [Name] - nvarchar, varchar, char, nchar, text, ntext, but every
time I receive 4 symbols. I can calculate the number of symbols with
Len command for other fields in the report with data type int, real.
I use in the field [Name] english and cyrillic letters and numbers.
Please help me !

Probably it's 'couse Name is a reserved word of access try to change the
fieldname in txtName or similar
or to try immediately test the left of another control
--
_ _
Ciao
MAssimiliano Amendola www.accessgroup.it
Cisa1 - I° Conferenza Italiana per Sviluppatori Access Arezzo 4+5
Giugno 2005 Sono aperte le iscrizioni Info: www.donkarl.com/it
 
F

fredg

I have field [Name] with length 200 in access report. When I try to calculate
the number of symbols in the field with Len([Name]) commnad, every time I
receive 4. I tried with different data types for [Name] - nvarchar, varchar,
char, nchar, text, ntext, but every time I receive 4 symbols. I can calculate
the number of symbols with Len command for other fields in the report with
data type int, real. I use in the field [Name] english and cyrillic letters
and numbers. Please help me !

The name of your report consists of 4 characters.
=Len([Name]) in a report will count the length of the actual name of
the report, not the length of data in a field named [Name].

Name is a reserved Access/VBA/Jet word and should not be used as a
field name. Access gets confused.
See the Microsoft KnowledgeBase article for your version of Access:

109312 'Reserved Words in Microsoft Access' for Access 97
209187 'ACC2000: Reserved Words in Microsoft Access'
286335 'ACC2002: Reserved Words in Microsoft Access'
321266 'ACC2002: Microsoft Jet 4.0 Reserved Words'

Change the field [Name] to something else, i.e. [ClientName],
[txtName], [AName], etc.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top