fill list box with file names

J

John W. Vinson

how to fill list box with file names sorted by date - newest first.
tia,
mcnewsxp

Look at the VBA help for the Dir() function, and use a loop to fill a Table.
Use that table (or a query based on the table) as the Row Source for the
listbox.
 
J

Jerry Whittle

1. What is the make of the table holding these names?
2. What is the name of the date field?
3. What is the name of the names field?
4. How many names are we talking about? A combo box might be a better choice.
 
M

mcnews

Look at the VBA help for the Dir() function, and use a loop to fill a Table.
Use that table (or a query based on the table) as the Row Source for the
listbox.

so the file names have to go into a table before i can sort them. no
way to let the dir() command do it. ok, i get it.
 
D

Dirk Goldgar

mcnews said:
so the file names have to go into a table before i can sort them.

Not necessarily, but it may be the easiest.
no way to let the dir() command do it. ok, i get it.

You could potentially fill an array in memory from the results of calling
the Dir() function and the FileDateTime() function in a loop, and then sort
that array, and then use a list-filling function to fill the list box from
your array. But it would involve some moderately complex coding.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Top