Results 1 to 3 of 3

Thread: Lost Event??

  1. #1

    Thread Starter
    Fanatic Member steve65's Avatar
    Join Date
    Jun 2000
    Posts
    610
    Hi,

    I am using a combobox with the style set to 2.

    What I would like to do is when the index changes from one value to another I would like to know so that I can display some other information on the form. I am not losing focus of the control, so that won't work.

    Is there event that I can use to perform this check? I have tried a listbox but I like the drop down style better.

    Thanks
    This space for rent...

  2. #2
    Fanatic Member
    Join Date
    Aug 2000
    Posts
    736
    How about something like this ? Store the initial value of the combo box and then check the value when the combo box is clicked.

    Code:
    Option Explicit
    Dim lastCombo As String
    
    Private Sub Combo1_Click()
        If Combo1.Text <> lastCombo Then
            MsgBox "Combo Value has Changed"
            lastCombo = Combo1.Text
        End If
    End Sub
    
    Private Sub Form_Load()
        lastCombo = "One"
        
        Combo1.AddItem "One"
        Combo1.AddItem "Two"
        Combo1.AddItem "Three"
        Combo1.AddItem "Four"
        
        Combo1.Text = "One"
    End Sub

  3. #3

    Thread Starter
    Fanatic Member steve65's Avatar
    Join Date
    Jun 2000
    Posts
    610

    Talking

    duh,

    Thanks
    This space for rent...

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