Visual basic validating odd number

To allow a space in front of after the number you can modify the check If Is Numeric(Trim(Text Box82)) = true Then However, I often like to apply both preventive and corrective measures when I validate data.

Just for curiosity if someone types a space before typing the number or a space after how do you treat that?

To allow a space in front of after the number you can modify the check If Is Numeric(Trim(Text Box82)) = true Then" id="ctl00_m_m_i_ctl00_gr_ctl01_bestanswerbody" class="textarea-bestanswerhidden" name="bestanswerbody" answerbody Id="3947196" / This If (Is Numeric(Text Box82) = true) Then will check if the textbox has a numeric value or not.

ahmedilyas you could use the Mod operator like so: if my Number Mod 2 = 0 then Message Box.

Hi, I would like to validate userform textbox entry for numbers only.

If you are migrating a Visual Basic 6 application to Visual Basic . From this page I have as well the idea that there are more and more a lot of *recommendations* on MSDN which conflict with each other. * 'Msg Box' does not suffer from the loads-of-overloads productivity stopper.

NET, there is no compelling reason to replace calls to Msg Box with Message Box. Cor * 'Msg Box' is fewer to type that 'Message Box. to revalidate if its whole number then he can use abs() i guess Dim x As Integer x = Input Box("Enter integer") If x = Int(x) Then Msg Box "integer" Else Msg Box "not integer" End If I'm just not sure if he means the vb integer (can have decimals), or the mathematical integer (no decimals) so thats all Im saying.Im sure he doesnt want decimals unless he has a customer stored under 2.53567...Crouchie, Although I use forever Messagebox, is your statement not true, Msg Box versus Message Box. NET, the Msg Box method is a Visual Basic Runtime wrapper around a call to the Message Box. You can also use CType to convert a Msg Box Result to a Dialog Result. Note Msg Box returns the same integer values returned by Message Box. The values in these enumerations have the same meanings: OK = 1, Yes = 6, No = 7, and so on.So if I enter 4 the program will read it as 40, and so on.