VBA and arabic script

unsted_t

New member
Local time
Tomorrow, 00:12
Joined
Oct 31, 2007
Messages
3
I'm struggling with this one. We have developed an application in Access 2003 using standard forms and controls (text boxes, etc). If I enter (by pasting because I can't type it in directly) so arabic text into a text box it displays OK. However, if I want to do anything with that text in vba I run into problems because the value of the text box only displays as "???????" ...

e.g

Dim strText as string

strText = me.txtText
Debug.Print strText

Output is something like "???????"

What am I doing wrong, or will this never work?

Any help would be greatly appreciated.

Regards

Tim
 
I'm struggling with this one. We have developed an application in Access 2003 using standard forms and controls (text boxes, etc). If I enter (by pasting because I can't type it in directly) so arabic text into a text box it displays OK. However, if I want to do anything with that text in vba I run into problems because the value of the text box only displays as "???????" ...

e.g

Dim strText as string

strText = me.txtText
Debug.Print strText

Output is something like "???????"

What am I doing wrong, or will this never work?

Any help would be greatly appreciated.

Regards

Tim


VBA is expecting ANSI characters with a value of 0-255, the arabic characters are unicode and can be worked with if you convert them.

Check out the strconv function.

For example this character ﮏ is û in unicode (which is character 143 and 251).
 
Thanks DJKarl,

However, I'm not sure how this will help me. One of the things our application does is allow users to search. So they enter arabic text into the search box and the vba creates a select statement to pass to SQL Server (it's an Access Project). The SQL statement is incorrect because it says something like:

"SELECT * FROM Titles WHERE Title LIKE '%????????%'"

How can I use what the user has entered to perform a task like this?
 
Last edited:
Thanks DJKarl,

However, I'm not sure how this will help me. One of the things our application does is allow users to search. So they enter arabic text into the search box and the vba creates a select statement to pass to SQL Server (it's an Access Project). The SQL statement is incorrect because it says something like:

"SELECT * FROM Titles WHERE Title LIKE '%????????%'"

Who can I use what the user has entered to perform a task like this?

Ok I think you are out of luck, displaying the information in a text box is one thing, trying to pass that to SQL Server is something else.
 

Users who are viewing this thread

Back
Top Bottom