In Access, the Asc function returns an integer representing the ANSI code corresponding to the first character in a string.
The syntax for the Asc function is:
Asc ( string )
The required string argument is any valid string expression. If the string contains no characters, a run-time error occurs. If more than one character is entered, the function will return the value for the first character and ignore all of the characters after the first.
Example
|
VBA Code
|
This example returns 65, the ANSI character code for an uppercase letter A. Now the MyNumber variable would contain the value 65.
SQL query
You can also use the Asc function in a query.
|