Results 1 to 5 of 5

Thread: Validate event not working in ActiveX

  1. #1

    Thread Starter
    New Member
    Join Date
    Aug 2001
    Posts
    8

    Exclamation Validate event not working in ActiveX

    Any thoughts on this one?...

    I made an activeX control project with two text boxes A and B. Both have CausesValidation = True

    If I run this control on a form, the boxes don't generate a validate event? I've researched it quite a bit, and unable to find information on it.

    Would greatly appreciate any help. thanks!

  2. #2
    -= B u g S l a y e r =- peet's Avatar
    Join Date
    Aug 2000
    Posts
    9,629
    I tried this, and it worked just fine,

    VB Code:
    1. Option Explicit
    2.  
    3. Private Sub Text2_Validate(Cancel As Boolean)
    4.     If Text2.Text = "" Then Cancel = True
    5. End Sub
    6.  
    7. Private Sub Text1_Validate(Cancel As Boolean)
    8.     If Text1.Text = "" Then Cancel = True
    9. End Sub

    could u describe in more details the problem u have?
    -= a peet post =-

  3. #3

    Thread Starter
    New Member
    Join Date
    Aug 2001
    Posts
    8
    Peet, Thanks for your feedback. I actually had something very similar to that. The problem was that the validate events were just not firing when moving focus between different constituent controls on the same ActiveX control

    I located a microsoft knowledge base article (Article ID: Q191912) which described the validate event not firing when going from a control on the ActiveX to a control on the Form. It stated that SP5 addressed that bug.

    Although the problem I was having was not exactly as described in the article referenced above, I downloaded SP5 and installed it.... and it worked!

    But, here's the funny thing. The but that was addressed in the article still happens!... I don't get a validate event when going from a constituent control on the ActiveX to a control on the form!

    Did you experience this at all?
    Zaig

  4. #4
    New Member
    Join Date
    Sep 2001
    Location
    Swindon, UK
    Posts
    11
    as far as I know, SP5 didnt fix the other bug in Validation - when you take press Return to activate a command button with the Default property = TRUE on a form (i.e. your OK button) , the Validate event doesn't fire (same as the original LostFocus bug which Validate wuz supposed to have fixed!!!!)

    dunno if thats relevant but its getting late in the afternoon here

  5. #5

    Thread Starter
    New Member
    Join Date
    Aug 2001
    Posts
    8

    Active X Validate Event Bug

    Thanks for your reply, shirtster.
    I agree. With your comment. So what's the way around it?
    zaig

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