I guys I need your help again on DoEvents. As You all know, doevents will repaint the windows so users wil not be annoy when we have a long loop.
Here's the situation: I load records from access and write it to a text file for exmaple:
VB Code:
Public Sub LoadName() Dim rc As Recordset, sql As String sql = "SELECT * FROM name" Set rc = cn.Execute(sql) Do While Not rc.EOF Writetext(rc("fistname")) DoEvents rc.MoveNext Loop
PS: i have like 30 000 records.
As you see, the doevents will repaint the window on every record. I read the forum someone post an alternative way for a doevent for like 10 times by
VB Code:
For i = 0 To 900 i mod 10 = 0 then DoEvents Next
But that only for a for ..next loop. Anybody know a way for the do ..while loop




Reply With Quote