StrConv
Using the StrConv Function
In this tutorial you will learn how to use the StrConv Function.
The StrConv function returns the position of the first occurrence of a string in another string.
=StrConv ( string, conversion [, LCID ] )
string a valid String
conversion an Integer sum to determine the conversion type
LCID the LocaleID if different to the System one
In this example we will use a given sentance: "change the case" and we wish to Proper Case it, i.e. make every first initial of a word Capitalised.
The result is Change The Case.
The Settings are:
Settings
Constant | Value | Description |
vbUpperCase | 1 | Converts the string to uppercase characters. |
vbLowerCase | 2 | Converts the string to lowercase characters. |
vbProperCase | 3 | Converts the first letter of every word in string to uppercase. |
vbUnicode | 64 | Converts the string to Unicode using the default code page of the system. (Not available on the Macintosh.) |
vbFromUnicode | 128 | Converts the string from Unicode to the default code page of the system. (Not available on the Macintosh.) |
FORM
In a Form you could set the Default Value of a Textbox to
=StrConv("change the case", 3)
VBA
In a Form add a TEXTBOX control and rename it "txtStrConv", then you could add the following in the Load Event.
Private Sub Form_Load()
txtStrConv = StrConv("change the case", 3)
End Sub
This Function can be used instead of UCase and LCase
Courses
Access Expert 13
Access 222
Seminars
Access SQL 2
Search
You can find more about this by searching the website.
By: Alex Hedley
Click here to sign up for more FREE tips
|