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 Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Browsing for file name, need to be able to select multiple files

Status
Not open for further replies.

Dijital

MIS
Mar 15, 2002
47
US
I am currently using the following code:
Private Sub CmdBrowse_Click()
On Error GoTo Err_CmdBrowse_Click

Dim strFile As String
With Me.cdlgOpen
.CancelError = True
.Filter = "All Files (*.*)|*.*|"
.ShowOpen
strFile = .FileName
MsgBox strFile 'just to test the value
End With

Exit_CmdBrowse_Click:
Exit Sub

Err_CmdBrowse_Click:
MsgBox Err.Description
Resume Exit_CmdBrowse_Click

End Sub

What I want to be able to do is select multiple files at once and have their locations pumped into an array, have it list the file locations in a list box, and then run a single command to import all the CSV files as individual tables into the database. Any help???

-Jim
 
Jim,

I don't offhand know of any APIs that will do this.

You could just put your code in a loop and fill your
own array, but this would probably make data entry
too slow.

If all the files are in the same directory, you could
use the Dir function in VBA and programmatically fill
an Access table with the file names. Then add a checkbox
and make a form to select them.

Just a thought,
Wayne
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top