patr1c1a 0 Newbie Poster

I have a form with a few textboxes where the user can add data to a database. It also has a "cancel" and a "close" button. Both do the same:

me.close()

I've used the "validation" event and the errorprovider control to prevent blank fields and not numeric data where numbers are required.
It all works well, but I found out the user can't cancel or close the form halfway through the data input because it keeps flashing the errorprovider and triggering the error messageboxes asking to fill in the required fields.
Is there a way to override the validation events when one of these buttons is pressed?
Thanks!!

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.