Home page
or browse popular tags
Access Functions

Sign up for the free email newsletter for new tips, tutorials and more. Enter your email address below, and then click the button.

Privacy Policy

RSS Twitter

Access: Chr Function


In Access the Chr function returns the character associated with the specified ANSI code.

The syntax for the Chr function is:

Chr ( charcode )

The required charcode argument is the NUMBER used to retrieve the character. The argument charcode is an integer between 0 and 255, inclusive. Applications for Microsoft Windows use the ANSI character set. ANSI character codes in the range 0 to 31, inclusive, are the same as the standard, nonprintable ASCII codes. For example, Chr(13) returns a carriage-return character, and Chr(10) returns a linefeed character. Together they can be used to force a new line when message strings are formatted with MsgBox or InputBox.


Chr( 65 )    returns "A"
Chr( 97 )    returns "a"

VBA Code

Dim MyChar
MyChar = Chr(100)

This example returns "d", the character associated with the specified character code. Now the MyChar variable would contain the value "d".

SQL query

You can also use the Chr function in a query.

SELECT Chr(37) AS Expr1, Chr(100) AS Expr2
FROM Orders

If you'd like to see how it works, enter SQL statement and press Execute


Add To: Add to dzone dzone | Digg this digg | Add to del.icio.us del.icio.us | Stumble it stumbleupon

  • Comments

Copyright © 2005-2023             www.WebCheatSheet.com All Rights Reserved.