Results 1 to 3 of 3

Thread: changing contents of a combo box

  1. #1

    Thread Starter
    Junior Member
    Join Date
    Apr 2000
    Posts
    16

    Question

    when i change the contents of combo box at run time using additem, any code thats in the combo1_click sub gets ran. How do i stop this? any help would be great

  2. #2
    Frenzied Member
    Join Date
    Mar 2000
    Posts
    1,089
    Hmm, declare a boolean variable at the top of your form, call it boolStopClickEventRunning

    then enclose all the code in your clickevent in an if statement like this

    Code:
    Private Sub Combo1_Click()
    
    If Not boolStopClickEventRunning Then
    
    'your click code here
    
    End If
    then when you add an item do it like this

    Code:
    boolStopClickEventRunning = True
    Combo1.AddItem MyItem
    boolStopClickEventRunning = False
    Hope this helps

  3. #3

    Thread Starter
    Junior Member
    Join Date
    Apr 2000
    Posts
    16

    Smile

    thanx, that did help

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