Home All Groups Group Topic Archive Search About

Change type case of data

Author
24 Feb 2005 4:01 PM
Timboo
Hi, Im executing an append query to import data into a table.  The imported
data source has the names in UPPER CASE and I would like to change this upon
import to Capital first letter only.

I am going to use the following code for standard data entry

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

The If clause ensures that if the user correctly types "MacDonald" or
"van Slyke", the program will leave it as entered.

                  John W. Vinson[MVP]   

- Thank you John, but as Im using an Append query, I dont think this can be
applied, any ideas welcome?  Thanks Tim

Author
24 Feb 2005 8:48 PM
Van T. Dinh
Use:

    StrConv([NameField], 3)

as the source for the Name instead of simply [NameField] in your Append
Query / SQL.

--
HTH
Van T. Dinh
MVP (Access)




Show quote
"Timboo" <Tim***@discussions.microsoft.com> wrote in message
news:B69530B1-0305-4ED3-A11D-29F5F8D159EB@microsoft.com...
> Hi, Im executing an append query to import data into a table.  The
imported
> data source has the names in UPPER CASE and I would like to change this
upon
> import to Capital first letter only.
>
> I am going to use the following code for standard data entry
>
> Private Sub txtSurname_AfterUpdate()
> If StrComp(Me!txtSurname, LCase(Me!txtSurname), 0) = 0 Then
>    Me!txtSurname = StrConv(Me!txtSurname, vbProperCase)
> End If
> End Sub
>
> The If clause ensures that if the user correctly types "MacDonald" or
> "van Slyke", the program will leave it as entered.
>
>                   John W. Vinson[MVP]
>
> - Thank you John, but as Im using an Append query, I dont think this can
be
> applied, any ideas welcome?  Thanks Tim
>

AddThis Social Bookmark Button