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 / Database Design / May 2005

Tip: Looking for answers? Try searching our database.

Input Mask

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Troy W - 04 May 2005 20:34 GMT
I have a textbox for a name.  I would like to put an input mask to force a
capital letter for the first letter in the name, but I have a problem with
names where there is another capital in it.  If I do >L<LL it forces the
last two letters to be lowercase, even if I want it to be capital.  Any help
would be really appreciated.

Troy W.
DL - 05 May 2005 10:04 GMT
Are you using names such as;
1) McAfee
2) Lawson Martin
3) Lawson-Martin
If using only (2) not to much problem, but a combination - difficult.

> I have a textbox for a name.  I would like to put an input mask to force a
> capital letter for the first letter in the name, but I have a problem with
[quoted text clipped - 3 lines]
>
> Troy W.
DL - 05 May 2005 22:07 GMT
As an afterthought, and in addition to John's post, as user exits the field,
a msg box that shows the text and requires a yes/no response.

> Are you using names such as;
> 1) McAfee
[quoted text clipped - 10 lines]
> >
> > Troy W.
John Vinson - 05 May 2005 18:56 GMT
>I have a textbox for a name.  I would like to put an input mask to force a
>capital letter for the first letter in the name, but I have a problem with
[quoted text clipped - 3 lines]
>
>Troy W.

Input masks simply are not capable of handling the complexity of name
capitalization.

What I do instead is use a bit of VBA code in the AfterUpdate event of
the name textbox, to see if the name is all lower case; if so it uses
the builtin StrConv() function to convert it to Proper Case (Each Word
Capitalized). If it's already mixed case, I'll assume that the user
wants it that way (McArthur or de la Cruz or Jones-Smith for example):

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

                 John W. Vinson[MVP]    
 
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.