Results 1 to 9 of 9
  1. #1
    3 Star Lounger
    Join Date
    Jan 2001
    Location
    Serbia and Montenegro (Yugoslavia)
    Posts
    342
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Change event of ComboBox not Triggering (VB6)

    Okay, this is another, probably really basic, question.

    I have a standard ComboBox and I want to trap for change events so I can enable a Save button. If the user types something, it fires. If the user clicks on the drop down and makes another selection, it doesn't.

    There doesn't appear to be any event that fires for this (except the click event which fires before anything in the box is changed). Does anyone have a trick they use to trap for this event?

  2. #2
    Gold Lounger
    Join Date
    Feb 2001
    Location
    Sint Niklaas, Belgium
    Posts
    2,778
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Change event of ComboBox not Triggering (VB6)

    You can use the Before Update or After Update events
    Francois

  3. #3
    Lounger
    Join Date
    Apr 2001
    Location
    KY USA
    Posts
    45
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Change event of ComboBox not Triggering (VB6)

    Or perhaps the .dirty property of the form.

  4. #4
    3 Star Lounger
    Join Date
    Jan 2001
    Location
    Serbia and Montenegro (Yugoslavia)
    Posts
    342
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Change event of ComboBox not Triggering (VB6)

    Oops, I meant to post this in the VB forum. VB doesn't have those handy events

  5. #5
    5 Star Lounger
    Join Date
    Jan 2001
    Location
    Newbury, Berkshire, England
    Posts
    712
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Change event of ComboBox not Triggering (VB6)

    And I thought Access was Hard!

  6. #6
    Gold Lounger
    Join Date
    Feb 2001
    Location
    Sint Niklaas, Belgium
    Posts
    2,778
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Change event of ComboBox not Triggering (VB6)

    I have do a little programing in VB long time ago.
    If I remember well, you have an ON GOT FOCUS and an ON LOST FOCUS.
    You can store the value of the combo in a variable in the ON GOT FOCUS and compare that value with the combo in the ON LOST FOCUS. IF they are different, the combo was changed and you can take some actions.

    Hope this help
    Francois

  7. #7
    3 Star Lounger
    Join Date
    Jan 2001
    Location
    Serbia and Montenegro (Yugoslavia)
    Posts
    342
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Change event of ComboBox not Triggering (VB6)

    I thought of something like that, but I want to catch it before the control looses focus. That will work if I mandate that the user must exit the field before the change is considered valid (which I may be forced to do)

  8. #8
    Plutonium Lounger
    Join Date
    Dec 2000
    Location
    Sacramento, California, USA
    Posts
    16,775
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: Change event of ComboBox not Triggering (VB6)

    Depending on which combobox you're using in VB, you may have a Validate event, which is the best one to use in most cases. It resembles the BeforeUpdate event of Access controls.
    Charlotte

  9. #9
    Plutonium Lounger
    Join Date
    Dec 2000
    Location
    Sacramento, California, USA
    Posts
    16,775
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: Change event of ComboBox not Triggering (VB6)

    No, compared to trying to build the same functionality into a VB front end, Access is a cake walk!
    Charlotte

Posting Permissions

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