Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Proper Casing in Microsoft Access

Status
Not open for further replies.

EBOUGHEY

Programmer
Aug 20, 2002
143
US
Hi,

I am not well versed in Access although I understand SQL and Foxpro well.

How are you able to update a field to proper case? I have tried several times both in the report form and in the actual table to no avail.

I'm sure it's simple. I just don't know my way around well enough.

Thanks for any help on this matter...

Elena
 
the StrConv([city],3) command is not working.

keep getting a compile error.

Thanks again for any assistance.
 
Hi,

I was lucky enough to come upon this function for creating proper names in Access recently.

Public Function StatementUCase(StrStat As String) As String
Dim i As Long
Dim Flag As Boolean
Dim HlpStr As String, MyStr As String
Flag = True
MyStr = StrStat
While Flag
i = InStr(MyStr, " ")
If i > 0 Then
HlpStr = Left(MyStr, i - 1)
HlpStr = UCase(Left(HlpStr, 1)) & LCase(Mid(HlpStr, 2)) & " "
StatementUCase = StatementUCase & HlpStr
MyStr = Mid(MyStr, i + 1)
Else
Flag = False
StatementUCase = StatementUCase & UCase(Left(MyStr, 1)) & LCase(Mid(MyStr, 2)) & " "
End If
Wend
StatementUCase = Trim(StatementUCase)
End Function

Paste this into a public module and you can then use it in update queries to change strings into proper case.

Let me know if this helps!

Regards,
CJA
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top