megatronixs
Registered User.
- Local time
- Today, 23:41
- Joined
- Aug 17, 2012
- Messages
- 719
Hi all,
I have now a macro that corrects the word in a field to proper case when it is copy paste and all letters are upper case. This works for normal fields in the form, but not in the subform. Is ti possible to fix it so it also works in the subform?
Greetings.
I have now a macro that corrects the word in a field to proper case when it is copy paste and all letters are upper case. This works for normal fields in the form, but not in the subform. Is ti possible to fix it so it also works in the subform?
Code:
Private Sub ClientCountry_Exit(Cancel As Integer)
Dim i As Long
If (StrComp(ClientCountry, UCase(ClientCountry), vbBinaryCompare) * StrComp(ClientCountry, LCase(ClientCountry), vbBinaryCompare)) = 0 Then
i = InStr(1, ClientCountry, " ")
ClientCountry = UCase(Mid(ClientCountry, 1, 1)) & LCase(Mid(ClientCountry, 2))
While i > 0
ClientCountry = Left(ClientCountry, i) & UCase(Mid(ClientCountry, i + 1, 1)) & Mid(ClientCountry, i + 2)
i = InStr(i + 1, ClientCountry, " ")
Wend
End If
End Sub
Greetings.