Results 1 to 2 of 2
  1. #1
    Jorge Junior is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    May 2011
    Posts
    1

    How to count characters?

    Hi!
    I'm new to Access and to the forum.



    I know how to use IBM Lotus Approach, but Access is a little different.
    In Approach, if I want to count only the letters in "six-year-old", I use:
    Length(Trim(Translate(FieldName, '-', '')))

    Trim to ignore the spaces and translate to ignore the hyphens by converting them to ''.

    I don't know how to do that in Access.
    I googled and found = Compr([FieldName]). In my case, the field name is PALAVRA and the type of data is text. The field that will show the number of letters is text too. I've already changed it to numeric, but it made no difference.

    I also tried =Len([FieldName]), but Access automatically changes =Len to =Compr.

    My Access is in Portuguese, but is says something like this "the search engine of the database doesn't recognise the field 'palavra' in a validation expression or the default value in the table.'

    Does anybody know how to do it?

  2. #2
    June7's Avatar
    June7 is offline VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,602
    Instead of Translate use Replace and instead of Length use Len.

    Don't know what you mean by 'changes =Len to =Compr'. Doesn't happen to me.

    You are saving this calculated value to table field? Why?

    Might need double quote marks ("") instead of the single '' (apostrophes).
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Need to delete special characters
    By tlrutledge in forum Queries
    Replies: 1
    Last Post: 08-23-2013, 03:10 AM
  2. enter more than 255 characters in a text box
    By reddy4305 in forum Access
    Replies: 2
    Last Post: 10-26-2010, 06:29 AM
  3. erase characters at the end
    By bjelinski in forum Access
    Replies: 14
    Last Post: 07-05-2010, 12:03 PM
  4. Parsing for data in between two characters
    By rawdata in forum Access
    Replies: 7
    Last Post: 11-02-2009, 04:46 AM
  5. Special Characters
    By orgelizer in forum Access
    Replies: 0
    Last Post: 03-20-2007, 08:24 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums