writes:
Quote:
>Hello,
>I am running the following in Excel and was trying to figure out how to do
>this in Access. This code opens the "File Open" dialog box, allows you to
>select the file(s) and then process those files. Thanks for the help:
> fileToOpen = Application.GetOpenFilename("MyFileType (*.csv),*.csv", ,
>"Open My Files", , True)
> If TypeName(fileToOpen) = "Boolean" Then Exit Sub
> For ctrOpen = 1 To UBound(fileToOpen)
> MsgBox fileToOpen(ctrOpen)
> Next
>Steven
Steven
Access does not have a built-in method of doing this. The best way (ie the
least likely to break) is to use the API for the Windows File Open/Save dialog
directly. The code for this is at The Access Web at http://www.mvps.org/access
in the API section. Just copy the code into a new module, and change the sample
function to only show the file types that you want. Although this might seem
very complicated, you don't need to understand how it works, just treat it as a
'black box'.
Jon
Access tips & tricks - http://www.applecore99.com
Microsoft Access webring -
http://nav.webring.yahoo.com/hub?ring=microsoftaccess