I have a program where there are text boxes that accept values and then a command button is pressed. I need to know how to let the program check if the values entered are negative or anything that isn't a number. I also need the program to understand that if the text box is empty it should read that as a value of zero instead of just giving me a runtime error.
sk8ndestroy14 294 Posting Virtuoso
Recommended Answers
Jump to PostYou can use the function IsNumeric to check if a certain string is numeric or not. It is numeric if it contains only numbers and only one "-" (negative sign). If no text is entered in the textbox, its text value is "". You can use If/Else selection for this.
All 3 Replies
scudzilla 32 Junior Poster
sk8ndestroy14 commented: Thanks for the help. +7
sk8ndestroy14 294 Posting Virtuoso
sk8ndestroy14 294 Posting Virtuoso
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.