Results 1 to 6 of 6
  1. #1
    Join Date
    Feb 2011
    Posts
    23

    Converting Infinity Symbol to 99999 in Query

    I'm struggling to convert '∞' to '99999' in vba.

    I've written a query which works fine, but as soon as I copy and paste the SQL into vba the '∞' gets changed to '', and this fails.


    Suspect it might be something to do with character sets:

    The code lifted from the query is
    Code:
    UPDATE Sheet1 SET Sheet1.F5 = '99999' WHERE (((Sheet1.F5)='∞'));
    When copied and pasted into the code the result is
    Code:
    SQLText = "UPDATE Sheet1 SET Sheet1.F5 = '99999' WHERE (((Sheet1.F5)=''))"
    Any pointers as to how to get this right will be greatly appreciated.

    Terry Lawson

  2. #2
    Join Date
    Jun 2015
    Location
    Wales. Land of the sheep.
    Posts
    1,228
    Why does it need to be in VBA, Cant you use an update query?

  3. #3
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,962
    Right, code can run the saved query object.

    How did you get the infinity symbol into query? I was able to copy/paste from your post but not from character map Symbol set.
    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.

  4. #4
    CJ_London is online now VIP
    Windows 10 Access 2010 32bit
    Join Date
    Mar 2015
    Posts
    11,446
    not tested but try (((Sheet1.F5)=chr(236))


    you may need to use the left function to ensure you only use 1 character from F5

    got it from here
    http://www.anysitesupport.com/insert...nto-documents/

  5. #5
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,962
    I tested in VBA immediate window, textbox, query - none display the infinity symbol.

    Did queries:

    SELECT Chr(236)="∞" AS Test, "∞" AS C FROM HX32;
    SELECT Chr(236)=Field1 AS Test, Field1 FROM HX32;
    SELECT Chr(236)=Left(Field1,1) AS Test, Field1 FROM HX32;

    The infinity symbol does display but the returns in Test are 0 - False.

    However, OP's UPDATE does work.
    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.

  6. #6
    Join Date
    Feb 2011
    Posts
    23
    Thanks all for suggestions

    I got the '∞' into the update query by copy and paste from the field in the table "Sheet1" that contains the symbol.

    As I read this thread all attempts to use vba have failed, have I missed something?

    I've solved the issue by importing the field which generates '
    ∞', a div/0 where 0 is is that field

    But if anyone would like to look further I would appreciate it, it's become an itch I must scratch!

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

Similar Threads

  1. How to add a symbol to a table entry
    By rebfein in forum Access
    Replies: 2
    Last Post: 08-23-2017, 04:16 PM
  2. Currency formatting without the USD symbol
    By Symlink in forum Access
    Replies: 1
    Last Post: 07-13-2013, 07:40 PM
  3. Prevent Euro Symbol
    By neil40 in forum Access
    Replies: 1
    Last Post: 01-20-2013, 03:47 PM
  4. Euro Symbol not showing
    By bellevue in forum Access
    Replies: 7
    Last Post: 04-17-2012, 03:27 AM
  5. Inch symbol in query filter criteria
    By sprovoyeur in forum Queries
    Replies: 3
    Last Post: 10-01-2009, 11:24 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