Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Fill a list Box with a OS command: DIR

Status
Not open for further replies.

asn3068

Programmer
Feb 18, 2000
2
ES
How can i fill a List Box with the result of OS Comand : Dir (example: c:\ca*.*)
 
I believe that VBA has a DIR function which provides a list of files. You could then use the callback function to populate the list box. The old sample MDA project that came with ACCESS had an example for building a list from table names within the database, this sample would be modified to use the DIR() function. In theory it should work relatively easily. I've been away from ACCESS for about a year otherwise I would try to give you a better outline of code. I do believe that the callback function for building filling a list will give you what you need. <p>Dave Brown<br><a href=mailto:dabrown@telespectrum.com>dabrown@telespectrum.com</a><br><a href= > </a><br>
 
<br>Hmmmm.<br><br>You'd have to use re-direction to store the results of the dos command in a text file. Then have your program open and parce the text file, loading the useable information in a string delimited with ';', then set the list box data source to that string.<br><br>Problem with the callback concept here is that you'd have to provide the address of your Access function to the DOS (internal) command. And of course the DOS internal command would have to be aware or this additional information and know how and when to use it. <p>Amiel<br><a href=mailto:amielzz@netscape.net>amielzz@netscape.net</a><br><a href= > </a><br>
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top