need to capitalize a field

fletch

New member
Local time
Today, 10:12
Joined
Jan 21, 2002
Messages
6
I have a database with two fields for emailing. Firstname and Email.

I want to run a query to capitalize just the first character of the Firstname field.

I figured out how to change the field to lowercase but that's it.

Now I need the first character changed to upper case.

I only know how to do queries. I often see samples in these forums of VB code but I don't know where or how to use it.

I did find the Proper function but don't know how to use it either.

Help?

Jim
 
As I stated, I don't know how or where to put that type of code.

I've only used the query expression builder up to this point.

If those things work, I unfortunately need specific instructions on how to use that code.

Jim
 
Try this in a new column in the query grid (using the correct table name):-

Field: FirstName: UCase(Left([TableName].[FirstName],1)) & LCase(Mid([TableName].[FirstName],2))

Show: check
 
thank you...perfect.

Now, I discovered there's some middle initials in the first name, is there a way to strip everything from the right away? Up to the first blank?

Jim
 
Try this:-

FirstName: UCase(Left([TableName].[FirstName],1)) & LCase(Mid([TableName].[FirstName],2,IIf(InStr([TableName].[FirstName]," ")>0,InStr([TableName].[FirstName]," ")-2,Len([TableName].[FirstName]))))
 
thank you. Again...perfect. Went from a 3 hour job to a 3 minute one.

Much appreciated.

Jim
 
Also, if you have to just convert just the first letter to upper case then proper case might be what you are after.


strConvertMe = StrConv(strConvertMe,vbProperCase)
 

Users who are viewing this thread

Back
Top Bottom