Results 1 to 5 of 5

Thread: TabStrip & CausesValidation

  1. #1
    Guest

    Question SSTab & Causes Validation

    Using VB6

    The SSTab control has a CausesValidation property
    that doesn't seem to work.

    I have some textboxes with various validation rules,
    but these don't seem to be called when you click on a tab.
    They are called when you try to shift focus to any other
    control on the form.

    Anyone else come across this problem???

    Many Thanks

    SeanR

    [Edited by SeanR on 10-05-2000 at 05:57 AM]

  2. #2
    I'm about to be a PowerPoster! Joacim Andersson's Avatar
    Join Date
    Jan 1999
    Location
    Sweden
    Posts
    14,649
    Do you have the validation code in the Validate event of the TextBoxes?

    I've tried putting an SSTab on a form and added a TextBox to the first tab. Added some code in the validate event (of the textbox) made sure the textbox had the focus and then clicked on the second tab. The validate code then ran perfectly.

    I use VB6 Enterprise SP3.

  3. #3
    Guest
    Thanks for the reply Joacim

    This is weird.

    I simlfied the whole thing, placed a SSTab on a form
    and two text boxes:-
    Text1 - with validation code (simply Cancel = True)
    Text2 - without

    All three control have causes CausesValidation = True

    If I try to switch focus from Text1 to Text2
    the validation code is triggered as it should

    If I try to switch focus from Text1 to a tab
    the validation code isn't triggered.


  4. #4
    Guest
    VB6 and finally SP4

    I've got it sorted

    As long as all my text boxes and labels are contained
    within a frame on each tab of the SSTab validation
    is triggered when a tab is selected, otherwise not.
    Strange !!!

    FYI

    Put an SSTab on a form, put a text box on the 1st tab
    and in the Validate sub put Cancel = True

    Now run it, once the text box is selected you can't
    select a tab, everything is as it should be.

    Now put a label on the 3rd tab, run it again
    and hey presto you can select tabs, which seems
    pretty strange to me.

    Put that label in a frame and everything works again

    Thanks again for your reply

    SeanR

  5. #5
    New Member
    Join Date
    Jan 2001
    Posts
    3
    I had the same problem with validation and the SSTab control. Using your information, I put all my labels on frames and now I no longer have the problem. It is a great workaround. Thank you.

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