Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Check if value is integer

Status
Not open for further replies.

paulbradley

Programmer
Oct 9, 2002
158
GB
How can I check to see if a value entered by a user is an integer. I have tried the Mod function but can't get it working properly.

Thanks.
 
Are you sure you want to test whether the value is an integer? Wouldn't it be easier to control the user's input by setting the data type at the table level (if the form is bound to a table) and/or specifying a format or input mask?

If testing the data type is what you really want to do, take a look at the VBA help on the following functions:

VarType()
IsNumeric()
Int()
Fix()
CInt()
TypeName()

Maybe you can find something there that will help you.

HTH...

Ken S.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top