MS Access: IsNumeric Function
This MSAccess tutorial explains how to use the Access IsNumeric function with syntax and examples.
Description
The Microsoft Access IsNumeric function returns TRUE if the expression is a valid number. Otherwise, it returns FALSE.
Syntax
The syntax for the IsNumeric function in MS Access is:
IsNumeric ( expression )
Parameters or Arguments
- expression
- It is a variant.
Returns
The IsNumeric function returns TRUE if the value is a valid number.
The IsNumeric function returns FALSE if the value is not a valid number.
Applies To
The IsNumeric function can be used in the following versions of Microsoft Access:
- Access 2019, Access 2016, Access 2013, Access 2010, Access 2007, Access 2003, Access XP, Access 2000
Example
Let's look at how to use the IsNumeric function in MS Access:
IsNumeric (786) Result: TRUE IsNumeric ("Tech on the Net") Result: FALSE IsNumeric ("234") Result: TRUE
Example in VBA Code
The IsNumeric function can be used in VBA code in Microsoft Access.
For example:
Dim LValue As Boolean LValue = IsNumeric("Tech on the Net")
In this example, the variable called LValue would contain FALSE as a value.
Example in SQL/Queries
You can also use the IsNumeric function in a query in Microsoft Access.
For example:
In this query, we have used the IsNumeric function as follows:
Expr1: IsNumeric([CategoryID])
This query will evaluate whether the CategoryID field contains a numeric value and display the results in a column called Expr1. You can replace Expr1 with a column name that is more meaningful.
For example:
NumericCategory: IsNumeric([CategoryID])
The results would now be displayed in a column called NumericCategory.
Advertisements