Results 1 to 10 of 10

Thread: [RESOLVED] validation question

  1. #1

    Thread Starter
    Member
    Join Date
    Jan 2007
    Posts
    59

    Resolved [RESOLVED] validation question

    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?

  2. #2

  3. #3

  4. #4

    Thread Starter
    Member
    Join Date
    Jan 2007
    Posts
    59

    Re: validation question

    so the CausesValidation property of control A needs to be = True?

  5. #5
    I'm about to be a PowerPoster! Hack's Avatar
    Join Date
    Aug 2001
    Location
    Searching for mendhak
    Posts
    58,333

    Re: validation question

    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.)

  6. #6

    Thread Starter
    Member
    Join Date
    Jan 2007
    Posts
    59

    Re: validation question

    clicking a control button

  7. #7
    I'm about to be a PowerPoster! Hack's Avatar
    Join Date
    Aug 2001
    Location
    Searching for mendhak
    Posts
    58,333

    Re: validation question

    Quote Originally Posted by bhs00
    clicking a control button
    You want to validate a control button's click?

  8. #8
    Oi, fat-rag! bushmobile's Avatar
    Join Date
    Mar 2004
    Location
    on the poop deck
    Posts
    5,592

    Re: validation question

    Quote Originally Posted by bhs00
    so the CausesValidation property of control A needs to be = True?
    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?

  9. #9
    I'm about to be a PowerPoster! Hack's Avatar
    Join Date
    Aug 2001
    Location
    Searching for mendhak
    Posts
    58,333

    Re: validation question

    Quote Originally Posted by bushmobile
    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?
    Which, in turn, won't do anything unless you have code in the controls validate event.

    (Command Buttons don't have a Validate Event so it has always made me giggle that it is a CausesValidation property. )

  10. #10
    Oi, fat-rag! bushmobile's Avatar
    Join Date
    Mar 2004
    Location
    on the poop deck
    Posts
    5,592

    Re: validation question

    Quote Originally Posted by Hack
    (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.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width