Welcome to SPN

Register and Join the most happening forum of Sikh community & intellectuals from around the world.

Sign Up Now!

input mask to capitalise first letter of surname

Discussion in 'Information Technology' started by mardoh, Nov 17, 2005.

  1. mardoh

    mardoh
    Expand Collapse
    Guest

    How do I set the properities of a surname field in a table to create an input
    mask that will capitalise the first letter of each surname?
     
  2. Loading...


  3. xRoachx

    xRoachx
    Expand Collapse
    Guest

    LOL, no problem. For the future, search the access help file for "Input
    Mask". You'll find some good examples.

    "mardoh" wrote:

    > Brilliant xRoachx!!! I've been tearing my hair out for the past few days
    > over this one! Thanks again from the "nearly bald lady"!!!
    >
    > "xRoachx" wrote:
    >
    > > Try the following:
    > >
    > > >L<?????

    > >
    > > The L indicates the first digit is required and must be a letter and the >
    > > ensures it is capitalized. The ? indicates the following digits are optional
    > > but are lower case letters. Also, be sure to include enough ? for the length
    > > of your field.
    > >
    > > "mardoh" wrote:
    > >
    > > > How do I set the properities of a surname field in a table to create an input
    > > > mask that will capitalise the first letter of each surname?
     
  4. mardoh

    mardoh
    Expand Collapse
    Guest

    Brilliant xRoachx!!! I've been tearing my hair out for the past few days
    over this one! Thanks again from the "nearly bald lady"!!!

    "xRoachx" wrote:

    > Try the following:
    >
    > >L<?????

    >
    > The L indicates the first digit is required and must be a letter and the >
    > ensures it is capitalized. The ? indicates the following digits are optional
    > but are lower case letters. Also, be sure to include enough ? for the length
    > of your field.
    >
    > "mardoh" wrote:
    >
    > > How do I set the properities of a surname field in a table to create an input
    > > mask that will capitalise the first letter of each surname?
     
  5. xRoachx

    xRoachx
    Expand Collapse
    Guest

    Try the following:

    >L<?????


    The L indicates the first digit is required and must be a letter and the >
    ensures it is capitalized. The ? indicates the following digits are optional
    but are lower case letters. Also, be sure to include enough ? for the length
    of your field.

    "mardoh" wrote:

    > How do I set the properities of a surname field in a table to create an input
    > mask that will capitalise the first letter of each surname?
     
  6. John Vinson

    John Vinson
    Expand Collapse
    Guest

    On Wed, 16 Nov 2005 13:15:08 -0800, mardoh
    <mardoh@discussions.microsoft.com> wrote:

    >How do I set the properities of a surname field in a table to create an input
    >mask that will capitalise the first letter of each surname?


    xRoach's suggestion will work...partially. It will capitalize only the
    first LETTER of the field, and lowercase the rest - and that only as a
    display, not changing what's actually stored. This will give you
    values like Mcdonald (for McDonald), Van der steen (for van der
    Steen), and Smith-hawken (for Smith-Hawken).

    You may want to use some VBA code in the Form control's AfterUpdate
    event ( you do need a form, tables have no usable events):

    Private Sub txtSurname_AfterUpdate()
    If StrComp(Me!txtSurname, LCase(Me!txtSurname), 0) <> 0 Then
    Me!txtSurname = StrConv(Me!txtSurname, vbProperCase)
    End If
    End Sub

    This will leave mixed case fields alone, but will take names in all
    lower case and convert them to Proper Case (Each Word Capitalized,
    Including Hyphenated-names).

    John W. Vinson[MVP]
     

Share This Page