Solved

Change Versus AfterUpdate

Posted on 2007-12-03
6
1,845 Views
Last Modified: 2010-05-18
I have a very simple question...When i double click on a textbox or combobox while in design mode in VBE it adds a sub procedure like Sub Textbox1_Change()....It never adds Sub Textbox1_afterupdate....I have used both and can't tell the difference....What is the difference between these two and is one better than the other?
0
Comment
Question by:ToddHawley4984
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
6 Comments
 
LVL 66

Expert Comment

by:Jim Horn
ID: 20397544
>What is the difference between these two and is one better than the other?
In my experience the only time Change is used is with tab controls, when a user clicks on a tab it fires the tab control Change event.  Otherwise, use AfterUpdate.
0
 
LVL 92

Accepted Solution

by:
Patrick Matthews earned 50 total points
ID: 20397576
Neither is intrinsically better than the other--it's a matter of what you need to, and picking the
right event to handle it.

For textboxes...
The Change event fires as soon as you start typing in the textbox.  AfterUpdate does not
fire until after you tab off of the control, basically.  So, if I want to enter "foo" into a text box,
the Change event would fire three times, and AfterUpdate just once.  There is also a
BeforeUpdate event that I find extremely useful if I need to validate entries.
0
 
LVL 92

Expert Comment

by:Patrick Matthews
ID: 20397592
Jim,

I'll use the Change event with list-only comboboxes.  I stay away from the Change event in
textboxes for the reason stated above :)

Regards,

Patrick
0
PeopleSoft Has Never Been Easier

PeopleSoft Adoption Made Smooth & Simple!

On-The-Job Training Is made Intuitive & Easy With WalkMe's On-Screen Guidance Tool.  Claim Your Free WalkMe Account Now

 
LVL 66

Expert Comment

by:Jim Horn
ID: 20397614
{a qualification on my earlier comment }
Most of that is from Access VBA experience.  Excel VBA or VB may differ, and if so matthewspatrick would know it.
0
 
LVL 9

Expert Comment

by:antontolentino
ID: 20398679
change event is useful if you want to simulate the auto complete suggestion list
0
 

Author Closing Comment

by:ToddHawley4984
ID: 31412398
Great thats what i was missing Thank you
0

Featured Post

PeopleSoft Has Never Been Easier

PeopleSoft Adoption Made Smooth & Simple!

On-The-Job Training Is made Intuitive & Easy With WalkMe's On-Screen Guidance Tool.  Claim Your Free WalkMe Account Now

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Microsoft Office Picture Manager is not included in Office 2013. This comes as a shock to users upgrading from earlier versions of Office, such as 2007 and 2010, where Picture Manager was included as a standard application. This article explains how…
This article describes a serious pitfall that can happen when deleting shapes using VBA.
This Micro Tutorial demonstrate the bugs in Microsoft Excel for Mac with Pivot Charts.
This Micro Tutorial demonstrates in Microsoft Excel how to consolidate your marketing data by creating an interactive charts using form controls. This creates cool drop-downs for viewers of your chart to choose from.

724 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question