About UpperCase (1 Viewer)

notrino

Registered User.
Local time
Tomorrow, 00:39
Joined
Oct 18, 2018
Messages
26
Hello I want to use UCase function for this letters;

ı-I ; i-İ

and I want to see this letters like this;

ı --> I
I --> I
i --> İ
İ --> İ


But I didn't do it. It is working always like this;

ı --> I
I --> İ
i --> İ
İ --> İ
Could you help me?

I attached my sample..Thanks.
 

Attachments

  • letter_sample.zip
    27.3 KB · Views: 74

isladogs

MVP / VIP
Local time
Today, 23:39
Joined
Jan 14, 2017
Messages
18,209
Use the Replace function for the characters you want to change
 

CJ_London

Super Moderator
Staff member
Local time
Today, 23:39
Joined
Feb 19, 2013
Messages
16,600
looked at your db, and your example in the post. Don't see a difference between what you want and what you get.

why not put > in the field and/or control format property - will display uppercase, although the source data remains unchanged. Access is not case sensitive so will not affect how it works.
 

notrino

Registered User.
Local time
Tomorrow, 00:39
Joined
Oct 18, 2018
Messages
26
Hello isladogs & CJ_London

isladogs,
I used Replace function, you can see at the attaced. But it didn't work.

CJ_London,
> function is convert the smal letters to big letters, but in the table, always small letters are recording. For example, enter te "a" from Form, in this situation Form is showing this letter like "A". But table recording is again "a". I want to recording letter must be "A" too from table.

So I have to use Replace or UCase functions but their mistake is

ı --> I ok.
I --> İ mistake
i --> İ ok
İ --> İ ok
 

CJ_London

Super Moderator
Staff member
Local time
Today, 23:39
Joined
Feb 19, 2013
Messages
16,600
as suggested before use the > in the field format in the table as well.

Replace seemed to work for me but suspect it is a language problem, find the ascii value of the relevant characters and try replace on that

replace(mystr,chr(ascii1),chr(ascii2))
 

notrino

Registered User.
Local time
Tomorrow, 00:39
Joined
Oct 18, 2018
Messages
26
Hi London,

Yes I tried all of them.It didn't work. When I defined i to İ converting, the system automatic convert all "I" letters to "İ" letters.
 

MajP

You've got your good things, and you've got mine.
Local time
Today, 18:39
Joined
May 21, 2018
Messages
8,522
Yes I tried all of them.It didn't work. When I defined i to İ converting, the system automatic convert all "I" letters to "İ" letters
No sure of what you actually ended up trying, but most of these string functions have a "compare" parameter. May need to set the compare to binary.
Replace( expression, find, replace [ , start [ , count [ , compare ]]] )
Settings The compare argument can have the following values:

Constant Value Description
vbUseCompareOption -1 Performs a comparison using the setting of the Option Compare statement.
vbBinaryCompare 0 Performs a binary comparison.
vbTextCompare 1 Performs a textual comparison.
vbDatabaseCompare 2 Microsoft Access only. Performs a comparison based on information in your database.
 

notrino

Registered User.
Local time
Tomorrow, 00:39
Joined
Oct 18, 2018
Messages
26
Hello MajP,

Thank you. But this information is above my level. Have you got any Access sample file for this solution? I'm very basic user, so I'm searching basic solution. Why is it diffucult, I don't understand.:banghead:

"i" must be "İ"
"ı" must be "I"
"İ" must be "İ"
"I" must be "I"

that's all :)
 

CJ_London

Super Moderator
Staff member
Local time
Today, 23:39
Joined
Feb 19, 2013
Messages
16,600
the problem I (and I suspect others) are having is using your alphabet. It does not display as expected with latin characters. So we are unable to reproduce the problem.

When I open the table, I see


I open the form, I see




these characters do not appear to be the ones you mention.

"i" must be "İ"
"ı" must be "I"
"İ" must be "İ"
"I" must be "I"

when I click the button, I get a communication error which implies the form has become corrupted.

I create a new form and copy your code

Code:
Private Sub Command8_Click()
Area1 = UCase(Area1)
Area1 = Replace(Area1, "i", "Ý")
Area1 = Replace(Area1, "ý", "I")
End Sub

For me, UCase does not appear to work, so commenting it out, the replaces do work, however the two replaces both replace the first character with "Ý". Which is a mystery to me.

I checked the ascii codes

?asc("i")
105
?asc("ý")
253
?asc("Ý")
221
?asc("I")
73

and changed the replace to use these chars

Area1 = Replace(Area1, Chr(105), Chr(221))
Area1 = Replace(Area1, Chr(253), Chr(73))

and get the same effect - both replaces replace the first char

tried with chrw (extended characterset)

'Area1 = Replace(Area1, ChrW(105), ChrW(221))
Area1 = Replace(Area1, ChrW(253), ChrW(73))


and same issue again - both replaces replace the first char.

So regret I am at a loss to explain the problem. Can only suspect it is something to do with the language
 

Attachments

  • Capture.JPG
    Capture.JPG
    12.3 KB · Views: 261
  • Capture1.JPG
    Capture1.JPG
    12.8 KB · Views: 258

MajP

You've got your good things, and you've got mine.
Local time
Today, 18:39
Joined
May 21, 2018
Messages
8,522
It is some language thing, I do not understand that either. The the first character and all other characters are actually capital Is in US regional settings.

Code:
Private Sub Command8_Click()
  Dim I As Integer
  For I = 1 To Len(Me.Area1)
    Debug.Print Asc(Mid(Me.Area1, I, 1)) & " " & Mid(Me.Area1, I, 1)
  Next I
End Sub
Results
Code:
73 I
32  
73 I
32  
73 I
32  
73 I
32 is the space between
 

Cronk

Registered User.
Local time
Tomorrow, 08:39
Joined
Jul 4, 2013
Messages
2,771
Try changing the keyboard setting to US. In my Windows 10 PCs, keyboard setting shows immediately to the left of the time/date display at the bottom of the screen.
 

notrino

Registered User.
Local time
Tomorrow, 00:39
Joined
Oct 18, 2018
Messages
26
Hello everybody it solved but I didn't understood this solution :)

Create a module;
Code:
Public Function TumuBuyuk(kelime)
    kont = Len(kelime)
    If kont <> 0 Then
        harf = Mid(kelime, 1, 1)
        If Asc(harf) = 73 Or Asc(harf) = 253 Then
            TumuBuyuk = TumuBuyuk & "I"
            Else If Asc(harf) = 221 Or Asc(harf) = 105 Then
            TumuBuyuk = TumuBuyuk & "İ"
            Else
            TumuBuyuk = TumuBuyuk & UCase(harf)
        End If
        For i = 2 To Len(kelime)
            harf = Mid(kelime, i, 1)
            If eharf = "." Or eharf = " " Or eharf = "-" Or eharf = "/" Then
                If Asc(harf) = 73 Or Asc(harf) = 253 Then
                   TumuBuyuk = TumuBuyuk & "I"
                    ElseIf Asc(harf) = 221 Or Asc(harf) = 105 Then
                    TumuBuyuk = TumuBuyuk & "İ"
                    Else
                    TumuBuyuk = TumuBuyuk & UCase(harf)
                End If
                Else
                If Asc(harf) = 73 Or Asc(harf) = 253 Then
                    TumuBuyuk = TumuBuyuk & "I"
                    ElseIf Asc(harf) = 221 Or Asc(harf) = 105 Then
                    TumuBuyuk = TumuBuyuk & "İ"
                    Else
                    TumuBuyuk = TumuBuyuk & UCase(harf)
                End If
            End If
            eharf = harf
        Next i
    End If
End Function

Button click event;

Code:
Area1 = TumuBuyuk(Area1)
 

mresann

Registered User.
Local time
Today, 15:39
Joined
Jan 11, 2005
Messages
357
Yo, peeps. Am I missing something? How about using the StrConv function?

Specifically,

strExample = StrConv("ÿ",vbUpperCase)
...would assign "Ÿ" to strExample

This function can do a whole slew of conversions, including upper case, lower case, and proper case characters for the entire unicode sequence. Much better and more consistent than the old standards Ucase and LCase, which don't work for non-ASCII characters for the most part.

Syntax and usage: https://docs.microsoft.com/en-us/office/vba/language/reference/user-interface-help/strconv-function
 

MajP

You've got your good things, and you've got mine.
Local time
Today, 18:39
Joined
May 21, 2018
Messages
8,522
Yo, peeps. Am I missing something? How about using the StrConv function?

Specifically,

strExample = StrConv("ÿ",vbUpperCase)
...would assign "Ÿ" to strExample

This function can do a whole slew of conversions, including upper case, lower case, and proper case characters for the entire unicode sequence. Much better and more consistent than the old standards Ucase and LCase, which don't work for non-ASCII characters for the most part.
@mressan
I am not so certain it would work. Those unicode characters get converted strangely as you move from language to language. I would try it. But if you look at my post most of those characters come up with 73 or 32 when they should not.
 

mresann

Registered User.
Local time
Today, 15:39
Joined
Jan 11, 2005
Messages
357
@mressan
I am not so certain it would work. Those unicode characters get converted strangely as you move from language to language. I would try it. But if you look at my post most of those characters come up with 73 or 32 when they should not.

You are probably right. I am only used to the English alphabet, which is but a subset of the entire Latin script that comprises the characters of languages originating from Western Europe, along with the Cyrillic script of eastern Europe.A very comprehensive summary on Wikipedia for the Latin script can be found at this link: https://en.wikipedia.org/wiki/Latin_script_in_Unicode

In any case, the specific characters that the OP posted were able to be converted properly using StrConv. I think I'll create a looping program to find out what all characters convert to, either upper or lower, but I would imagine that the geniuses behind StrConv (and other language equivalents) have already done all the correlations, or at least one would think.
 

Users who are viewing this thread

Top Bottom