Validating a field and Cancel button

mlarrea
12-11-2001, 09:08 AM
Hi there, I need help with this PLEASE :)
I have a form that has a text box field that cannot be left blank, so I have a Validate event for it. Now that said, when I user makes a mistake and wants to cancel out of the form altogether by pressing a Cancel button, the application won't let him get out of the text box until the correct data is entered. This is very annoying... Is there anyway that the validation can be skipped if the user clicks on a specific button? Or is there any other way to solve this?
Thanks a lot :)

Monica

Thinker
12-11-2001, 09:21 AM
Set the CausesValidation property of the cancel command button to false.

Banjo
12-11-2001, 09:22 AM
Try this:

cmdCancel.CausesValidation = False

mlarrea
12-11-2001, 09:28 AM
Thank you guys! That's exactly what I needed...

EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum