Results 1 to 15 of 15
  1. #1
    GraeagleBill's Avatar
    GraeagleBill is offline Experienced Old Geezer
    Windows 10 Access 2013 32bit
    Join Date
    Feb 2011
    Posts
    2,097

    Using special Unicode characters in a report label control

    I'm trying to use some special characters taken from the Wingding 2 font set. According to the Windows layout for that font set, the characters I'm wanting to use are Unicode code 0x61 and 0x61. The compiler does not accept what I've coded. How does one get such characters in report design mode?

    Code:
    Private Sub Report_Open(Cancel As Integer)
    Dim lblLeft As String
    Dim lblRight As String
    
    
    lblLeft = ChrW(0x61) & ChrW(0x61) & ChrW(0x61) & ChrW(0x61) & ChrW(0x61) & ChrW(0x61) & ChrW(0x61)
    lblRight = ChrW(0x62) & ChrW(0x62) & ChrW(0x62) & ChrW(0x62) & ChrW(0x62) & ChrW(0x62) & ChrW(0x62)
    
    
    Me.lblBreakfast = lblLeft & "  BREAKFAST  " & lblRight
    End Sub


  2. #2
    June7's Avatar
    June7 is offline VIP
    Windows 11 Access 2021
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,771
    Can't mix font styles except maybe in a textbox set for Rich Text and then have to use HTML tags.
    Would have to put Wingdings 2 character in own label on each side of label with normal text.
    Can simply copy/paste character from map into label on report (Font Name set to Wingdings 2). It won't display as special character in design view for form or report.

    Looks like these are ASCII code 97 and 98. How I determined that:
    1. copy/paste character from map into label caption on form and Font Name set to Wingdings 2 then open form
    2. VBA in immediate window: ?Asc(Forms!Main.Label50.Caption)

    VBA code to set caption:
    Me.somelabel = Chr(97)
    Last edited by June7; 04-01-2025 at 10:41 AM.
    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.

  3. #3
    GraeagleBill's Avatar
    GraeagleBill is offline Experienced Old Geezer
    Windows 10 Access 2013 32bit
    Join Date
    Feb 2011
    Posts
    2,097
    I did this
    copy/paste character from map into label caption on form
    but just get a lower case "a". I created a test sub with a text variable being set to chr(97) but get an "a" there as well. I have to assume I don't quite get what you're trying to teach me?

  4. #4
    CJ_London is online now VIP
    Windows 10 Access 2010 32bit
    Join Date
    Mar 2015
    Posts
    11,932
    If these are arrow keys the number is in a much higher range if using a normal font

    try something like chrw(2190) or chrw(8651)

    Google ‘Unicode symbols’ or similar for a full listing

    alternatively if just for a single character in a label use a webdings or windings font as suggested by June


    edit: here is an example link, there are plenty, some better than others
    https://altcodeunicode.com/alt-codes...arrow-symbols/

    Numbers can be in excess of 100000, but chrw has a limit of around 65000 due to the nature of the parameter

  5. #5
    jojowhite's Avatar
    jojowhite is offline Competent Performer
    Windows 11 Access 2021
    Join Date
    Jan 2025
    Posts
    434
    You can also use 3 Label controls instead of 1.
    the the left and Right labels with Webding2 font.
    the left is Right-aligned while the right is left-aligned.
    Click image for larger version. 

Name:	BFAST.png 
Views:	20 
Size:	2.8 KB 
ID:	52900

  6. #6
    GraeagleBill's Avatar
    GraeagleBill is offline Experienced Old Geezer
    Windows 10 Access 2013 32bit
    Join Date
    Feb 2011
    Posts
    2,097
    Perfect! What Unicode value did you use to create the example you've posted? I.e., Chrw(?)

    I looked for it here: https://www.vertex42.com/ExcelTips/unicode-symbols.html , but no success.

  7. #7
    June7's Avatar
    June7 is offline VIP
    Windows 11 Access 2021
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,771
    As I said, Font Name property must be set for Wingdings 2. And it will not show symbol in Design view, it will show "a" or other letter. The code I posted worked for me - no variable used. Perhaps a Variant type variable would work but I have doubt.
    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.

  8. #8
    GraeagleBill's Avatar
    GraeagleBill is offline Experienced Old Geezer
    Windows 10 Access 2013 32bit
    Join Date
    Feb 2011
    Posts
    2,097
    Yes,
    Font Name property must be set for Wingdings 2
    does make a difference. Given the correct font name, the use of the Alt key together with the decimal code, I can enter the value for the desired character directly into a label control. E.g., Alt-97 will give me what London posted on the left side of BREAKFAST in #5.

    The decimal codes for Wingdings 2 can be found here: https://www.alanwood.net/demos/wingdings-2.html

  9. #9
    June7's Avatar
    June7 is offline VIP
    Windows 11 Access 2021
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,771
    Well, that table confirms the code I discovered with my technique.

    I tried Alt 97 and it doesn't work for me.
    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.

  10. #10
    GraeagleBill's Avatar
    GraeagleBill is offline Experienced Old Geezer
    Windows 10 Access 2013 32bit
    Join Date
    Feb 2011
    Posts
    2,097
    I tried Alt 97 and it doesn't work for me.
    Does that imply that if I were to go to Win 11 and O21, as you have, that my app will fail. I'm not sure how Access saves rendering values, at design or at runtime.

    In any case, thanks June for your leading me in the right direction.

  11. #11
    June7's Avatar
    June7 is offline VIP
    Windows 11 Access 2021
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,771
    Copy/paste character from map works as does the VBA. Character displays in form view. Just the Alt 97 is not working.

    However, this laptop is running Windows 10 with Access 2021. Getting ready to upgrade to Windows 11. My other laptop already upgraded to Windows 11.
    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.

  12. #12
    GraeagleBill's Avatar
    GraeagleBill is offline Experienced Old Geezer
    Windows 10 Access 2013 32bit
    Join Date
    Feb 2011
    Posts
    2,097
    Thanks for all your help June. I don't have any idea why I can Alt-97 and Alt-98 from font Wingding 2 directly into a label control while you can't?

    I'm still predomintly using a self-built desktop machine un-qualified for Win 11. I won't do anything to rectify that until I absolutely have to. My laptop will upgrade with the normal Windows option.

    Thanks again, Bill

  13. #13
    June7's Avatar
    June7 is offline VIP
    Windows 11 Access 2021
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,771
    "I can Alt-97 and Alt-98 from font Wingding 2"
    What do mean by "from" - exactly where are you using the Alt key sequence?


    My laptops are also "un-qualified" for Win 11 because they don't meet "minimum" specs. However, I discovered those limitations can be bypassed. Upgraded one machine and it works just fine. https://www.tomshardware.com/how-to/...pm-requirement
    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.

  14. #14
    GraeagleBill's Avatar
    GraeagleBill is offline Experienced Old Geezer
    Windows 10 Access 2013 32bit
    Join Date
    Feb 2011
    Posts
    2,097
    "I can Alt-97 and Alt-98 from font Wingding 2"
    In report design mode, I select the label control of interest. Then, having selected Wingding 2 in the Font Name properties, I hold done the Alt key and type in the number 97 on the keyboard's numbers pad and release the Alt key. Summarily with Alt-98.

  15. #15
    June7's Avatar
    June7 is offline VIP
    Windows 11 Access 2021
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,771
    Oh right, numeric keypad, not number keys from alpha-num keyboard. Yes, that works. I wonder if this will be an issue for smaller laptops that don't have separate numeric keypad. My guess is it should still work.

    Be aware that holding down Alt key solo will trigger shortcut key popup tips on ribbon.
    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. Remove Special Characters using VBA
    By vad77 in forum Programming
    Replies: 9
    Last Post: 10-02-2024, 12:08 PM
  2. Replies: 1
    Last Post: 08-02-2018, 03:45 PM
  3. Using Replace() for special characters
    By RayMilhon in forum Programming
    Replies: 2
    Last Post: 01-07-2017, 02:44 PM
  4. Need to delete special characters
    By tlrutledge in forum Queries
    Replies: 1
    Last Post: 08-23-2013, 03:10 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