Sorting out a Listbox

Meridian2000
09-06-2003, 04:03 PM
Can anyone help? I've written a VB program that will read in the titles of all the text files in a given directory and enter them into an Access database, then in turn the program reads the files from the database into a list box, the problem I have is that although the titles are in alphabetic order when viewed in the database, when they're read into the listbox they appear out of order... I'm using VB 5 and Access 2000. is there a fast sorting routine?

reboot
09-06-2003, 05:41 PM
Listbox.Sorted = False

Lar_19
09-06-2003, 08:16 PM
... I'm using VB 5 and Access 2000. is there a fast sorting routine?
No need to sort them yourself, just do as suggested by reboot and use the list box's sorted property. However you will need to set this in design mode because if you use "Listbox.Sorted = True" you will get a"Can't assign to read-only property" error if you try it at run-time. At least that's the case in VB5.

Meridian2000
09-07-2003, 05:49 AM
... I'm using VB 5 and Access 2000. is there a fast sorting routine?
No need to sort them yourself, just do as suggested by reboot and use the list box's sorted property. However you will need to set this in design mode because if you use "Listbox.Sorted = True" you will get a"Can't assign to read-only property" error if you try it at run-time. At least that's the case in VB5.


many thanks, that worked a treat

EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum