If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
Update vs Change
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. -- Steve S |
#2
|
|||
|
|||
Update vs Change
On Sat, 24 Jan 2009 10:29:01 -0800, Steve S wrote:
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. Update is when you are finished, usually when you tab out of the control. Change is per key-stroke. Before Update is usually used to react to what the user entered and possibly dissallow it (validation). AfterUpdate is used to respond to what the user entered without the ability to cancel it. Change is the least used of the three generally. -- Rick Brandt, Microsoft Access MVP Email (as appropriate) to... RBrandt at Hunter dot com |
#3
|
|||
|
|||
Update vs Change
"Steve S" wrote in message
... 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. -- Steve S 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 |
Thread Tools | |
Display Modes | |
|
|