How can I get a text box to display the arabic version of a name

pfiroz

Registered User.
Local time
Yesterday, 21:09
Joined
Jan 21, 2009
Messages
27
Hi All:):)
I'm building a database in English but it has arabic people. One of the features that I need to include is some text boxes next to the names in english that will automatically display the name in arabic when the english version is typed in.
So far I had added the language update back for microsoft and changed my regional settings in Windows XP to add Arabic. This seems to be working fine since the option arabic is now showing up in the properties settings for the objects in my Access database forms. So I changed the 'Keyboard Language' setting in the properties for one of these name text boxes I have in my form. So if I type anything in this text box now it shows as arabic. But this is not quite what I'm needing. I don't want to directly type into this text box but just have it automatically update with the same name as the official name text box (which is in english and will be the one the user actually types into) but just in arabic. I've set these two text boxes equal to each other hoping that the arabic text box will convert the name in the official name text box. But it doesn't. I just puts the english version of the word in the arabic text box. So basically, the only way I'm getting the arabic text box to display arabic is if I type directly into it. I tried some VBA in the 'After Update' Event of the Official text box properties setting the arabic text box = official text box value. But this again just put the english version of the name in to arabic text box.
??? not sure how to make this work.
Please Help!! :confused::confused:
 
I'm not 100% sure, but I think you will find it nigh on impossible to automatically convert a name input in English to Arabic.

Firstly I doubt that there is a one to one concordance between the English and Arabic alphabets, so with out some very clever coding you will not be able to type in a name in one language and have it appear correctly in another.
To do what you want, you would need and English to Arabic names dictionary.

The only thing I can suggest; is to have the name input twice, once in English and once in Arabic, and then display the appropriate version as required
 
I have often wondered what Access is like for Chines, Japanese and Arabic.

Would expressions like Is Null etc still be English.

Although the difference is very small the Australian Access has maximize and forecolor instead of maximise and forecolour etc.
 
Apparently Japanese VBA looks like this;

Code:
Option Compare Database

Public Function FileBackUp( _
Optional Generation As Integer = 1, _
Optional TargetFolder As String = "")

Dim FSO As Object 'ファイルシステムオブジェクト
Dim objFol As Object 'ターゲットフォルダオブジェクト
Dim objFile As File 'ターゲットファイルオブジェクト
Dim strTgtFile As String '対象ファイル名
Dim BakFileType As String 'バックアップファイル拡張子
Dim BakFileName As String 'バックアップファイル名
Dim UpdateTime As Date 'バックアップファイル更新時間
Dim iFileNum As Integer 'バックアップファイル数
Dim DelFileName As String '削除ファイルネーム


'エラートラップ
On Error GoTo err_FsoCopy:

'FileSystemObjectの作成
Set FSO = CreateObject("Scripting.FileSystemObject")

'バックアップの拡張子設定
BakFileType = ".bak"

'コピー元として、使用中のMDBのパスを取得
strTgtFile = CurrentDb.Name

'フォルダが存在しない場合
If FSO.FolderExists(TargetFolder) = False _
And TargetFolder <> "" Then

FSO.CreateFolder (TargetFolder)

'引数が設定されていない場合
ElseIf TargetFolder = "" Then

'引数が無い場合はMDBと同フォルダを設定
TargetFolder = FSO.GetParentFolderName(strTgtFile)
End If

'フォルダオブジェクト作成
Set objFol = FSO.GetFolder(TargetFolder)

'バックアップファイルの数をチェック
For Each objFile In objFol.Files

'ファイル名チェック
If Mid(objFile.Name, 9) = FSO.GetBaseName(strTgtFile) _
& BakFileType Then
iFileNum = iFileNum + 1 'バックアップファイル数
End If
Next

'バックアップがすでに設定数分ある場合の処理
If iFileNum = Generation Then

UpdateTime = Now

For Each objFile In objFol.Files

'ファイル更新時間のチェック
If UpdateTime > objFile.DateLastModified _
And Mid(objFile.Name, 9) = FSO.GetBaseName(strTgtFile) _
& BakFileType Then

UpdateTime = objFile.DateLastModified
DelFileName = objFile.Name
End If
Next

'一番古いファイルを削除
FSO.DeleteFile TargetFolder & "\" & DelFileName
End If

'ファイル名を設定
BakFileName = TargetFolder & "\" _
& Format(Now(), "mmddhhnn") _
& FSO.GetBaseName(strTgtFile) & BakFileType

'ファイルのコピー(同名ファイルは上書き)
FSO.CopyFile strTgtFile, BakFileName, True
'Beep

  err_Exit:
Set objFile = Nothing
Set objFol = Nothing
Set FSO = Nothing
Exit Function

err_FsoCopy:
MsgBox Err.Description
Err.Clear
Resume err_Exit:

End Function

'動作確認用プロシージャ
Private Sub BackUpTest()
Call FileBackUp 2,
End Sub

Looks like most of the commands are still English and it is just the object names that are in Japanese.

From here
 
I just tried a little experiment. Made a table with a text field and entered a few records but with two records the same and with

ファイルシステムオブジェクト

2 forms and open form2 from form1 and the Where worked on the ファイルシステムオブジェクト

I then enterer from the character map a couple of

and the Where clause worked.

So is a text field more than a text field.
 
SO you got a match with the string ファイルシステムオブジェクト ("File System Object") and the symbol ♣ (ace of clubs)?
 
Not quite.

Since certain version (2000?), Access always has supported unicode, which is why we can have all those characters.

If you create a new table with just one text, and type one row "foo" then open it up in Notepad, you will see it outputted as " f o o", and if you even have a hex editor, it would be probably something like this "00 66 00 6F 00 6F"

Unicode consumes 2 bytes, which is why we have each empty byte preceding each english alphabet. Now if we were to insert three Japanese characters... let's say ファイ, which is more likely to have a value greater than 255 (e.g. one byte), the Unicode declares it to have value of 12501, 12449, 12452 so the binary output would be read as
30 D5 30 A1 30 A4. In notepad (e.g. where only ASCII is supported), it would be probably read as "0Õ0¡0¤"

Basically, it's all about how it is encoded. ASCII is one way of encoding characters into 1-byte sets, giving us 256 possible values to map a character to, while Unicode uses 2 bytes and therefore has 65,536 possible values to map a character to. In any RDBMS, it is traditional to specify character sets and collation (e.g. sorting order) for one's particular purpose. Access doesn't really provide that decision, probably because Microsoft felt that they should keep it simple and straightforward as possible by assuming Unicode, but allowing you to choose sort order, (IINM, which are also affected by your Windows Regional Settings).

HTH.
 
Last edited:
Yep.

One of the reasons I put character symbol in was I thought it might be assigning some value to the unrecognisable and hence that would be all seenas the same:) but that was not the case.

I might play around and see things like InStr pick it up.
 
This worked OK

Exp: Left([xyz],InStr([xyz],"♠")-1)
 

Users who are viewing this thread

Back
Top Bottom