Results 1 to 5 of 5
  1. #1
    haggis999 is offline Advanced Beginner
    Windows 10 Access 2016
    Join Date
    Nov 2012
    Location
    Southampton, UK
    Posts
    60

    Question Can you stop StrConv(string, vbProperCase) from removing accents?

    One of my Access forms has a textbox that is coded to automatically convert all text input to proper case, using StrConv(string, vbProperCase). I have just noticed that some accented characters in the original text are replaced by non-accented versions of those characters, while other accented characters survive the process. For example, a c with a circumflex accent is stripped of its accent, while a c with a cedilla is unaffected (both these accents are used in French, Portuguese and Turkish, in addition to other languages).



    If I disable the StrConv code then everything works fine. The problem exists in both Access 2007 and Access 2016.

    Is this behaviour a bug or by design? More importantly, is there a way to persuade StrConv to stop messing with the accents?

  2. #2
    ranman256's Avatar
    ranman256 is offline VIP
    Windows Vista Access 2010 32bit
    Join Date
    Apr 2014
    Location
    Kentucky
    Posts
    9,525
    I doubt it. StrConv is a built in function.

  3. #3
    isladogs's Avatar
    isladogs is offline MVP / VIP
    Windows 10 Access 2010 32bit
    Join Date
    Jan 2014
    Location
    Somerset, UK
    Posts
    5,977
    I think all you can do is a work round like this:
    a) go through & identify all characters that get modified using StrConv
    b) before running StrConv - replace with a unlikely symbol like ¬ or a string like CFLX
    c) run StrConv
    d) reverse replace all instances of CFLX or ¬ or whatever

    It will work ... but be a bit tedious to setup

  4. #4
    haggis999 is offline Advanced Beginner
    Windows 10 Access 2016
    Join Date
    Nov 2012
    Location
    Southampton, UK
    Posts
    60
    Quote Originally Posted by ridders52 View Post
    I think all you can do is a work round like this:
    a) go through & identify all characters that get modified using StrConv
    b) before running StrConv - replace with a unlikely symbol like ¬ or a string like CFLX
    c) run StrConv
    d) reverse replace all instances of CFLX or ¬ or whatever

    It will work ... but be a bit tedious to setup
    Thanks for that suggestion. It would do the job, but this problem is only a minor issue in the app where I discovered this odd behaviour, so I might not bother to fix it. My question was simply driven by curiosity. I was struggling to think of any logical reason why StrConv handled some accented characters and not others.

    I have since looked a little closer at StrConv's optional LocaleID parameter. This lets you use something other than the default LocaleID on your system, but I suspect that changing the LocaleID (and thus the code page) would simply change which accented characters didn't work properly.

  5. #5
    orange's Avatar
    orange is offline Moderator
    Windows 10 Access 2010 32bit
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,726

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

Similar Threads

  1. Loss of letter accents - dbf to access
    By Plastique in forum Import/Export Data
    Replies: 1
    Last Post: 06-03-2016, 01:34 PM
  2. VbProperCase Change
    By wes9659 in forum Forms
    Replies: 6
    Last Post: 08-13-2014, 01:10 PM
  3. StrConv missing only č,ć
    By DK22 in forum Access
    Replies: 1
    Last Post: 04-24-2014, 11:30 AM
  4. Replies: 1
    Last Post: 07-07-2011, 08:32 PM
  5. Removing all letters or all numbers from string
    By Hayley_sql in forum Programming
    Replies: 2
    Last Post: 09-16-2009, 02:01 AM

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