tags:

views:

21

answers:

2

I would like the user to import the files into my Access VBA, I wonder if I can make the interface to be a bit like Windows Explorer:

With the window split into 2 halves, user can highlight the directory on the left half, and then the right half will show the files inside (even better if it can filter the file with specific extension), the use can select the files by clicking the checker box.

Is it possible in Access 2007 VBA, I don't want to reinvent the wheel again.

Thanks.

A: 

Have a look at

How to: Display and Use the File Dialog Box

astander
thanks for that, but what if I want to "squeeze" OR "embed" the whole dialogue in a form?
lokheart
Not gonna work, the File dialog is a popup form. No squeezing into forms... You can try to create your own, but I think you would be wasting your time...
astander
A: 

Nothing built in as far as I know so that leaves rolling you own. If it was me doing it I would be doing something like this

  • Treeview control on the left
  • Listview control on the right
  • Two buttons in the middle one to add one to remove

The Treeview would be populated with the file structure of the machine (links at the end on how to do this) When the user clicks on the add button it adds the full path and the file name to the listview in separate columns.

A bit of a pain but not that hard once you break it down

Link to how to get file info in VBA http://www.everythingaccess.com/tutorials.asp?ID=List-files-recursively

Kevin Ross
There is no native Access treeview, which makes it pretty much impossible to use reliably. This is quite unfortunate. I don't know why they haven't added one, as going as far back as A97, there was a treeview in the developer tools (it didn't work very well in distribution, unfortunately).
David-W-Fenton