decmial in an integer field

S

steve

what's the easiest way to detect that the user entered a decimal in an
integer field? (i'm using VB.net) infopath displays the the red
border but if the user attempts to save the form anyway they get an
error.

thanks
 
S

S.Y.M. Wong-A-Ton

If you are referring to how to check it in code, you can use Int32.Parse() to
check whether the decimal can 'fit' in an integer. If it cannot, the Parse
method will raise an error. Catch that error and do whatever you want with it.

E.g.
Dim myInt As Integer = Int32.Parse(myDec.ToString())
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top