B
Bo Hansson
In my Word 2K VBA-application I'm using an Access database table to store
information. When presenting information to the user, I load some records
into a Word VBA listbox, and by clicking on the different column headings of
that box, the user can choose the desired sorting. It works OK, but the
sorting/loading process is very slow compared to what you experience if you
change the sorting in an Acess table interface. My code structure is as
follows:
Set dbsDok = OpenDatabase(----.mdb")
Set rstDok = dbsDok.OpenRecordset("SELECT * FROM --- WHERE --- ORDER
BY ---;")
If rstDok.BOF = False Then rstDok.MoveFirst
Do While rstDok.EOF = False
listBox.AddItem
listBox(llistBox.ListCount - 1, 0) = rstDok("---")
'
'
'
listBox.List(listBox.ListCount - 1, 7) = rstDok("---")
rstDok.MoveNext
Loop
rstDok.Close
dbsDok.Close
Can anyone explain the slow action and tell me how to improve it ?
/BosseH
information. When presenting information to the user, I load some records
into a Word VBA listbox, and by clicking on the different column headings of
that box, the user can choose the desired sorting. It works OK, but the
sorting/loading process is very slow compared to what you experience if you
change the sorting in an Acess table interface. My code structure is as
follows:
Set dbsDok = OpenDatabase(----.mdb")
Set rstDok = dbsDok.OpenRecordset("SELECT * FROM --- WHERE --- ORDER
BY ---;")
If rstDok.BOF = False Then rstDok.MoveFirst
Do While rstDok.EOF = False
listBox.AddItem
listBox(llistBox.ListCount - 1, 0) = rstDok("---")
'
'
'
listBox.List(listBox.ListCount - 1, 7) = rstDok("---")
rstDok.MoveNext
Loop
rstDok.Close
dbsDok.Close
Can anyone explain the slow action and tell me how to improve it ?
/BosseH