Khmer font problem with MsgBox in VBA

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • sophannaly
    New Member
    • Mar 2014
    • 67

    Khmer font problem with MsgBox in VBA

    Hi,

    When I output data from table to textbox in form, it will shows Khmer Unicode character correctly. But if I output it with MsgBox function, then it will shows as ?.

    Could anybody tell me how to solve this because I would like to output in Khmer character?

    Best regards,
    Sophanna
  • zmbd
    Recognized Expert Moderator Expert
    • Mar 2012
    • 5501

    #2
    From my understanding:

    You may be using an old version of the font, try finding the newest version you can online.

    Even with the newer versions, for the message box you may still have to convert each Khmer character to the equivalent Hex values, then convert back to the system font using chrw() to build the string.

    Best of Luck.

    Comment

    • sophannaly
      New Member
      • Mar 2014
      • 67

      #3
      Hi zmbd,

      My OS in win8.1 enterprise and I use its default font from OS. So it means that this font is still not new enough? In converting each khmer character to Hex values, do I need to add like &H in front of this hex values?

      Best regards,
      Sophanna

      Comment

      • zmbd
        Recognized Expert Moderator Expert
        • Mar 2012
        • 5501

        #4
        OK:
        After some research thru the microsoft domain of accurate but obscure information, it appears that neither the VBE nor the standard MSGBOX() are unicode compliant - at least thru Windows7/Office2010.

        From your information, this appears to hold true for Windows8.1

        Then only workaround I have for you is to build a form that mimics a message box... insert a lable, a command button, and in ACC2010 you could use the graphics library to import a few symbols and use those as the graphics.

        You will either have to use the "&H" or convert to the equivalent decimal value and then use the CHRW() to add/build your string.

        Would like to be able to give you better news; however, it is what it is (^_^)

        OK, GOTA RUN, The Gremlins just attacked another one of the instruments in the lab.

        Comment

        • sophannaly
          New Member
          • Mar 2014
          • 67

          #5
          Hi zmbd,

          Thanks for your reply. I have tried with Hex value by adding &H and then use chrw() in message box, but it still shows as ?. You said about mimic msgbox, if I have 10 msgbox with different meanings, what should I do? Should I make 10 different mimic msgbox?

          Sophanna

          Comment

          • zmbd
            Recognized Expert Moderator Expert
            • Mar 2012
            • 5501

            #6
            As I noted in my last post, the MSGBOX() is TBMK not unicode compliant.

            As for using a form: what I have for such "message boxes" is a single generic form that I pass openargs to, either with custom string for the message or using a standard set. The on open event then parses the opening arguments and sets the standard message or the custom message. Mind you, I do this mainly for "help" dialogs when the standard message box wont do the trick.

            BOL

            Comment

            • sophannaly
              New Member
              • Mar 2014
              • 67

              #7
              Hi zmbd,

              Thanks you so much for your reply and it gave me idea on how to solve this problem.

              Sophanna

              Comment

              Working...