if focus is currently on control A and the user clicks on control B. What property of what control needs to be set for control A to be validated?
Printable View
if focus is currently on control A and the user clicks on control B. What property of what control needs to be set for control A to be validated?
VB Code:
A.CausesValidation = True
VB Code:
B.CausesValidation = True
;)
so the CausesValidation property of control A needs to be = True?
What controls are you using?
By default, the CausesValidation property is set to true on all textboxes and command buttons (and probably others as well.)
clicking a control button
You want to validate a control button's click?Quote:
Originally Posted by bhs00
no (but as Hack said, it's normally defaults to True). If a control has CausesValidation = True, then before it's due to receive focus, it fires the _Validate event in the control that has just lost focus, geddit?Quote:
Originally Posted by bhs00
Which, in turn, won't do anything unless you have code in the controls validate event.Quote:
Originally Posted by bushmobile
(Command Buttons don't have a Validate Event so it has always made me giggle that it is a CausesValidation property. )
CausesValidation has no bearing on the button (i.e. on itself), only on the control that the button gains focus from, which may very well have a _Validate event.Quote:
Originally Posted by Hack