devxlogo

Avoiding the Validation When the User Presses Cancel

I have very simple way to do this with just one line of code. Place the following line in the proper position, often the first line in LostFocus event (assuming the cancel control is named CancelControl).

 If activeControl is CancelControl then exit Sub


This tip is also suitable for VB5.

Charlie has over a decade of experience in website administration and technology management. As the site admin, he oversees all technical aspects of running a high-traffic online platform, ensuring optimal performance, security, and user experience.

See also  How Engineering Leaders Spot Weak Proposals

About Our Editorial Process

At DevX, we’re dedicated to tech entrepreneurship. Our team closely follows industry shifts, new products, AI breakthroughs, technology trends, and funding announcements. Articles undergo thorough editing to ensure accuracy and clarity, reflecting DevX’s style and supporting entrepreneurs in the tech sphere.

See our full editorial policy.