Access Numeric Functions

This list gives a brief description of the most useful functions to manipulate numbers in Microsoft Access VBA.

Note that functions are always followed by a pair of brackets even if - like Rnd() - there's nothing in between them. The Access editor will sometimes remove these brackets but by entering them you are telling Access that you are attempting to use a function.

Abs(<number>) Returns the absolute value of <number>.
Cos(<number>) Returns the cosine of <number> radians. See Sin and Tan
e Access does not have the value of e built in. Use Exp(1) to calculate e raised to the power of 1 or just define 2.718281828459 as a constant.
Exp(<number>) Returns e^<number>. See Log
Fix(<number>) Returns the whole number between <number> and zero. Identical to Int for positive numbers. Be careful with negative numbers.
Int(<number>) Returns the nearest whole number less than <number>. Identical to Fix for positive numbers.
Log(<number>) Returns the natural (base e ) logaritm of <number>. See Exp
Pi Access VBA does not have the value of pi built in. Use 3.1415926536 or however many digits you require.
Rnd() Returns a random number. Use Randomize() to control the random number generator.
Sgn(<number>) Returns 1, 0, or -1 when <number> is positive, zero, or negative.
Sin(<number>) Returns the sine of <number> radians. See Cos and Tan
Sqr(<number>) Returns the square root of <number>. Generates a runtime error if <number> is negative.
Tan(<number>) Returns the tangent of <number> radians. Generates a runtime error if <number> is Pi /4. See Cos and Tan

Other functions

Access date and time functions

Access logical functions

Access text functions

Access Tips

FoxPro Tips

General Tips

 

Related Items

Alvechurch Data - Microsoft FoxPro and Access Database Development and Training

Alvechurch Data are based close to Birmingham and provide training and development support for small businesses using Microsoft FoxPro, Visual FoxPro and Access databases.

Read More

Custom Toolbars

Your Access database will look more impressive if you add custom toolbars.

Read More

Development Services

Alvechurch Data specialise in Microsoft Access and FoxPro and have fifteen years experience developing databases for small business use.

Read More

Training Services

Details of the training courses in Microsoft Access and FoxPro offered by Alvechurch Data.

Read More

Support Services

How Alvechurch Data can help you with maintenance and support of your Access and FoxPro databases.

Read More