Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / General 2 / May 2008

Tip: Looking for answers? Try searching our database.

Input mask for last name

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
salt417 - 22 Jan 2006 19:21 GMT
I would like to create a mask that will force the first letter to be upper
case but optional (upper or lower) for all subsequent letters in the name
like McCarthy.  Is this possible?
G. Vaught - 22 Jan 2006 20:06 GMT
There is some VBA code you can use that will force Proper Case regardless
how someone types in the data. If you use a mask then it would be harder due
to the varing degrees of typed name lengths. You are better off with
sticking with one format either all lower, all upper, or all proper.

Read this article Microsoft Knowledge base.
http://support.microsoft.com/kb/302499/en-us

>I would like to create a mask that will force the first letter to be upper
> case but optional (upper or lower) for all subsequent letters in the name
> like McCarthy.  Is this possible?
salt417 - 23 Jan 2006 00:06 GMT
OK so looks like I'll have to do it with VBA.  That helps, thanx.

> There is some VBA code you can use that will force Proper Case regardless
> how someone types in the data. If you use a mask then it would be harder due
[quoted text clipped - 7 lines]
> > case but optional (upper or lower) for all subsequent letters in the name
> > like McCarthy.  Is this possible?
John Vinson - 22 Jan 2006 21:51 GMT
>I would like to create a mask that will force the first letter to be upper
>case but optional (upper or lower) for all subsequent letters in the name
>like McCarthy.  Is this possible?

Input Masks are simply not flexible enough to do this.

What you can do instead is put some VBA code in the textbox's
AfterUpdate event on a Form (and yes, you must use a form - table
datasheets have no usable events). If the textbox is named txtLastName
the code would be

Private Sub txtLastName_AfterUpdate()
If StrComp(Me!txtLastName, LCase(Me!txtLastName), 0) = 0 Then
  Me!txtLastName = strConv(Me!txtLastName, vbProperCase)
End If
End Sub

This will convert any text entered in all lower case to Proper Case
(First Letter Of Each Word Capitalized) but leave anything originally
in mixed case alone.

                 John W. Vinson[MVP]    
salt417 - 23 Jan 2006 00:08 GMT
Great, I am using input froms so this should work, thanx.

> >I would like to create a mask that will force the first letter to be upper
> >case but optional (upper or lower) for all subsequent letters in the name
[quoted text clipped - 18 lines]
>
>                   John W. Vinson[MVP]    
larryo - 09 May 2008 22:22 GMT
Signature

larryo

> >I would like to create a mask that will force the first letter to be upper
> >case but optional (upper or lower) for all subsequent letters in the name
[quoted text clipped - 19 lines]
>                   John W. Vinson[MVP]    
> John,
I made about 15 attempts over about 1 1/2 hours, to use the above
information by copying and pasting it into "After Update".  However no matter
what changes/modifications I made, it wouldn't work.  The Name is LastName,
the Control Source is LastName.  When I click on Code Builder and get to the
VBA page, here is what appears:
Private Sub LastName_AfterUpdate()

End Sub
So, I inserted your If statement, in the middle.  Should txt be included, or
deleted?  I tried it both ways - neither one worked.
Larry O'
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.