PC Review


Reply
Thread Tools Rate Thread

How do I set it up to automatically capitalize the 1st letter?

 
 
Sol
Guest
Posts: n/a
 
      4th Jan 2008
I am learning to use Access 2003. I want the database to automatically
capitalize the 1st letter of the last and first name.

 
Reply With Quote
 
 
 
 
fredg
Guest
Posts: n/a
 
      4th Jan 2008
On Fri, 4 Jan 2008 08:45:01 -0800, Sol wrote:

> I am learning to use Access 2003. I want the database to automatically
> capitalize the 1st letter of the last and first name.


Using a form for the data entry, code the AfterUpdate event of the
FirstName control to:

Me![FirstName] = StrConv([FirstName],3)

Do similar code in the LastName AfterUpdate event as well.

Note: this will improperly capitalize any name that normally should
have more than one capital, i.e. O'Brien, McDonald, Smith-Young, etc.
and also incorrectly capitalize names that should not be capitalized,
i.e. van den Steen, etc.

--
Fred
Please respond only to this newsgroup.
I do not reply to personal e-mail
 
Reply With Quote
 
John W. Vinson
Guest
Posts: n/a
 
      4th Jan 2008
On Fri, 4 Jan 2008 08:45:01 -0800, Sol <(E-Mail Removed)> wrote:

>I am learning to use Access 2003. I want the database to automatically
>capitalize the 1st letter of the last and first name.


Here's some VBA code I use in the AfterUpdate of each textbox for which you
want this to happen. It checks first to see if the user has already input
mixed case, so as not to mess up correctly capitalized names such as
"O'Brien", "McDonald" and "van der Steen".

Private Sub textboxname_AfterUpdate()
If StrComp(Me!textboxname, LCase(Me!textboxname), 0) = 0 Then
Me!textboxname = StrConv(Me!textboxname, vbProperCase)
End If
End Sub


John W. Vinson [MVP]
 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
capitalize first letter rodchar Microsoft Excel Misc 13 19th Dec 2008 01:47 PM
capitalize first letter automatically raft Microsoft Excel Misc 5 1st May 2008 01:10 PM
capitalize first letter automatically when typing in excel cell raft Microsoft Excel Misc 1 23rd Apr 2008 10:10 AM
automatically capitalize first letter in numbered list dkzeus Microsoft Word Document Management 1 6th Feb 2008 02:20 AM
How to automatically capitalize first letter of numbered list? =?Utf-8?B?bXdoYXJ0b24x?= Microsoft Word Document Management 3 24th Mar 2007 05:21 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 03:47 PM.