Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Form Control Validating Event

Status
Not open for further replies.

RileyCat

Programmer
Apr 5, 2004
124
0
0
US
I have a "Validating" event on a text box. The problem I'm having is, if the user presses the <Cancel> or <Exit> button on my form I don't want the validating function to happen.

How can I identify if the user is in the validating function because of a <Cancel> or <Exit> button and not fire off the validating error?

Stay Cool Ya'll! [smile2]

-- Kristin
 
you can raise a Flag when the cancel or exit button is hit.
(ie in the button_click event)

then inside the validating error event subroutine check for the Flag.if Flag is raised then exit the subroutine or else execute the validation for textbox

Sri
 
Set the CausesValidation property of your <Cancel> or <Exit> buttons to False.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top