Floating Point Numbers Validation

By | 2019-08-25

Just like the title says, the code in the attached file will validate the floating point numbers in a text box.

Usage

Create a form with a textbox, and insert the following into the form code:

Private Sub Form_Load()

   Text1.Text = Empty

End Sub

Private Sub Text1_KeyPress(KeyAscii As Integer)

   ' Precision is 2 in this case
   ' Send the Precision Value same in both the Functions
   Call ValidateNum(Text1, 2, KeyAscii)

End Sub

Private Sub Text1_KeyUp(KeyCode As Integer, Shift As Integer)

   Call ValidateDel(Text1, 2, KeyCode)

End Sub

Attachments

FileUploadedSize
966-20190825-145002-fpnumval.zip8/25/2019 2:50:02 PM1329
Author: dwirch

Derek Wirch is a seasoned IT professional with an impressive career dating back to 1986. He brings a wealth of knowledge and hands-on experience that is invaluable to those embarking on their journey in the tech industry.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.