Steve S said:
What is the difference (other than the spelling) between the ..Update
event
and the Change event for a text box and/or a combo box.
You've got a good answer from Rick....
I even expand on this more.
The change event fires for every single key press you use, and furthermore
to detect what the value of the text box is, you actually have to use
me.NameOfTextBox.Text
notice and above how I've used the text property of that control on the
form, normally in almost all cases we use:
me.NameOfTextBox.Value
or
me.NameOfTextBox (the default property of the text box is value, so
we often or for the most part leave it out)
So when you use the chang event of a control, the contents of that text box
have not been updated, and the value property has not yet been updated.
(commited) In fact this is about the only time that we used the text
property of a control on a form, otherwise it's not much use and ".text" is
only legal when the contorl has focus.
As a general rule you'll not use the change event of a contorl very often,
perhaps for key press processing or some action that to occur while you're
editing a text box. In other words each change by typing/editing/etc. that
modify the contents of that box, the change event fires each time that
occurs.
The before update, or after update events do not fire until you are done
editing that controll and then are attempting to move out of the control.
Furthermore it's important to note that these events do not fire if a user
does NOT change the contents of the text box (or if the user stars and
adding a text box and realizes are on the wrong text box, and then the
edit->undo, the after update events will not fire -- however during an
editing and change process the change event will be firing.
In general when you're using a list box or combo box, you'll still use the
after update event to do something on the form in response to a user having
changed or selected a value in the combo or list box.
i