A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Access » New Users
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

fill list box with file names



 
 
Thread Tools Display Modes
  #1  
Old April 20th, 2010, 05:04 PM posted to microsoft.public.access.gettingstarted
mcnews
external usenet poster
 
Posts: 231
Default fill list box with file names

how to fill list box with file names sorted by date - newest first.
tia,
mcnewsxp
  #2  
Old April 20th, 2010, 07:22 PM posted to microsoft.public.access.gettingstarted
John W. Vinson
external usenet poster
 
Posts: 18,261
Default fill list box with file names

On Tue, 20 Apr 2010 09:04:46 -0700 (PDT), mcnews
wrote:

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.
--

John W. Vinson [MVP]
  #3  
Old April 20th, 2010, 07:57 PM posted to microsoft.public.access.gettingstarted
Jerry Whittle
external usenet poster
 
Posts: 4,732
Default fill list box with file names

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.
--
Jerry Whittle, Microsoft Access MVP
Light. Strong. Cheap. Pick two. Keith Bontrager - Bicycle Builder.


"mcnews" wrote:

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

  #4  
Old April 22nd, 2010, 04:29 PM posted to microsoft.public.access.gettingstarted
mcnews
external usenet poster
 
Posts: 231
Default fill list box with file names

On Apr 20, 2:22*pm, John W. Vinson
wrote:
On Tue, 20 Apr 2010 09:04:46 -0700 (PDT), mcnews
wrote:

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.
--

* * * * * * *John W. Vinson [MVP]


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.
  #5  
Old April 22nd, 2010, 05:56 PM posted to microsoft.public.access.gettingstarted
Dirk Goldgar
external usenet poster
 
Posts: 2,529
Default fill list box with file names

"mcnews" wrote in message
...

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.

--
Dirk Goldgar, MS Access MVP
Access tips: www.datagnostics.com/tips.html

(please reply to the newsgroup)

 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 04:14 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.