troubleshooting Question

How to validate several fields and if input is invalid, drop out of module and set focus on the field in question before proceeding?

Avatar of Redtracer
Redtracer asked on
Visual Basic Classic
6 Comments1 Solution191 ViewsLast Modified:
Using VB 6.0 with SP5.  I have an input form where I check several fields for proper input.  To do this, I click the "SAVE" button and this calls a module.  My code checks all fields for validity - this works fine, but if, say, that first input field has invalid or no data, a message pops up and at this point I want to stop the module and set focus back onto the field in question.  The user should then have to click "SAVE" again to repeat the process of saving the input to a database.  Right now, regardless, the module steps through all fields on the form and puts an error message up for everything not valid.  How do I stop this and all of these error messages from appearing.  My module consists of IF statements.  I had experimented with a loop but could not make it work.  Any suggestions or even a simple code example would do.   Thank you!

Our community of experts have been thoroughly vetted for their expertise and industry experience.

Join our community to see this answer!
Unlock 1 Answer and 6 Comments.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 6 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros