954,535 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

Error Check

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
Posting Virtuoso
1,852 posts since Mar 2007
Reputation Points: 437
Solved Threads: 1
 

You 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.

scudzilla
Posting Whiz in Training
277 posts since Mar 2007
Reputation Points: 27
Solved Threads: 17
 

Thanks for helping but now I have a few other problems with the same program. I don't know how to change a datatype from variant to currency part way through a program.

sk8ndestroy14
Posting Virtuoso
1,852 posts since Mar 2007
Reputation Points: 437
Solved Threads: 1
 

Nevermind. I figured out how to change datatypes. I finished the program. Thanks for the help.

sk8ndestroy14
Posting Virtuoso
1,852 posts since Mar 2007
Reputation Points: 437
Solved Threads: 1
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You