Access: StrConv Function

In Access, the StrConv function convert a string to upper case, lower case, proper case, or several other formats.

The syntax for the StrConv function is:

StrConv ( string, conversion, LCID )

string  String expression to be converted.
conversation The type of conversion to perform.
LCID  LCID is optional. The LocaleID, if different than the system LocaleID. If this parameter is omitted, the StrConv function assumes the system LocaleID.

The following is a list of valid parameters for conversion.

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.
vbFromUnicode 128 Converts the string from Unicode to the default code page of the system.

Example

StrConv( "Access function",1 )        returns "ACCESS FUNCTIONS" 
StrConv( "Access Functions",2 )       returns "access functions"
StrConv( "access functions",3 )       returns "Access Functions"

VBA Code

Dim MyString
MyString = StrConv("WebCheatSheet",vbUpperCase)

This example uses the StrConv function to convert a string to upperCase. Now the MyString variable would contain the value “WEBCHEATSHEET”.

SQL query

You can also use the StrConv function in a query.

SELECT StrConv([ItemDesired],1) AS Expr1 
FROM Orders

admin

admin

Leave a Reply

Your email address will not be published.