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!

about:doevents()

Status
Not open for further replies.

horoscope

Technical User
Dec 1, 2002
17
CN
For loop1 = 1 To rec.RecordCount
TDM = DoEvents()
If lst.Text = 'abc'Then
txtUserID.Text = rec.Fields("UserID")
End If
rec.MoveNext
Next loop1
why use doevents() in this program?
 
Let's turn that around a little; why do you think it shouldn't be?
 
DoEvents() will allow events to be fired. Otherwise, the app will be 'locked' at least until the loop is done.
 
DoEvents is something to be used with caution - you need to consider that it might allow the user to click on a button and have the button code executed while you're in the middle of something else...

mmilan
 
But, for the record, that's not to say that it should never be used.

mmilan
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top