Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Change Event

Status
Not open for further replies.

FoxProProgrammer

Programmer
Joined
Apr 26, 2002
Messages
967
Location
US
The definition of the Change Event is:

The Change event occurs when the contents of a text box or the text portion of a combo box changes.

Why does the Change event occur if you select a combo box and don't change the value? Example: if the item selected in a combo box is "Test1" and you select the combo box but choose "Test1", why does the Change event occur? It seems to me that based on the definition it shouldn't fire or did I misinterpret the definition.

Thanks.

dz
 
It also occurs *every* keystroke. What are you trying to accomplish. The BeforeUpdate and AfterUpdate events *only* occur when the value has changed.

HTH RuralGuy (RG for short) acXP winXP Pro
Please respond to this forum so all may benefit
 
Thanks for your reply. I'm not changing the contents of the text portion of the combo box. I simply select the combo box and choose the same value that is already displayed. I don't see why this fires the Changed event. The reason that I tried the Changed event is because the BeforeUpdate and AfterUpdate events were firing when I select the combo box but don't change its value. Based on the definition, I figured that the Changed event would do what I want - which is fire only if the value of the combo box changes.

dz
 
I was not aware that the BeforeUpdate and AfterUpdate events of a ComboBox fired even though the value has not changed. That is a new one on me. I tested it and you are correct. You could compare the current Value to the OldValue to filter out the spurious events if you wanted to.

HTH RuralGuy (RG for short) acXP winXP Pro
Please respond to this forum so all may benefit
 
To All! . . .

Its been my experience over so great a many years the the [blue]On Change[/blue] event should've been named [blue]On Updated[/blue].

Looking at it this way should explain everything! [thumbsup2]

Calvin.gif
See Ya! . . . . . .

Be sure to see FAQ219-2884:
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top