Browse DevX
Sign up for e-mail newsletters from DevX

Tip of the Day
Language: Visual Basic
Expertise: Beginner
Oct 1, 1996



Building the Right Environment to Support AI, Machine Learning and Deep Learning

InputBox Function: Type Mismatch Errors

I have written a small program that calculates geometry problems. I have used input boxes to retreive data from the keyboard, however during runtime if I click the cancel button on the input box I get the error message "Type Mismatch".This happens in the part of the program that does the calculations (After I've got the numbers to calculate).What do I do?

You are probably taking the value returned from InputBox and putting it directly into a calculation. You cannot always do this, since the box will be blank if the user presses Cancel. If you check the value against two double quotes first, that should get rid of the type mismatch.

DevX Pro
Comment and Contribute






(Maximum characters: 1200). You have 1200 characters left.



Thanks for your registration, follow us on our social networks to keep up-to-date