Here's a function from a small mock up of your situation that may be helpful.
it is based on assumption that preferredLang is represented by the language/alphabet
used to record the FirstName.
Sample data
Code:
id |
FirstName |
LastName |
PreferredLang |
1 |
David |
Fare |
|
2 |
Felix |
Genth |
|
3 |
A.F. |
Berth |
|
4 |
Bern |
Nelroy |
|
5 |
V.N. |
Halu |
|
6 |
Claude |
Van Dam |
|
7 |
Polly |
Dactyl |
|
8 |
Ura |
Payne |
|
9 |
Paige |
Turner |
|
10 |
يوحنا |
ابراهيم |
|
11 |
نال |
جابر |
|
Sample function
Code:
Function EorA(sName As String) As String
'routine to see if first char of name is English or Arabic
Dim alpha As String
Dim i As Integer
alpha = "abcdefghijklmnopqrstuvwxyz"
If InStr(alpha, Left(sName, 1)) > 0 Then
EorA = "english"
Else
EorA = "Arabic"
End If
End Function
Sample test routine
Code:
Sub testEorA()
Dim rs As Dao.Recordset
Set rs = CurrentDb.OpenRecordset("Select id,firstName,lastname from tblNames")
Do While Not rs.EOF
'
'demo to print the result but you could assign the value to PreferredLang and update the record
'
Debug.Print rs!id, EorA(rs!firstname)
rs.MoveNext
Loop
rs.Close
End Sub
Result
Code:
1 english
2 english
3 english
4 english
5 english
6 english
7 english
8 english
9 english
10 Arabic
11 Arabic