Article ID: 824272 - View products that this article applies to.
This article applies to a Microsoft Access database (.mdb) and a Microsoft Access project (.adp).
Advanced: Requires expert coding, interoperability, and multiuser skills.
For a Microsoft Access 2002 version of this article, see 279508
This article discusses how to use the new FileDialog method in Microsoft Access to display the built-in File dialog box and to determine the files that the user selects.
Note The FileDialog method works only in the full retail version of Microsoft Access. This method does not work in a Microsoft Access run-time application.
In earlier versions of Microsoft Access, you may display the file dialog box by using either the Microsoft Common Dialog ActiveX control or by making calls to the Windows API.
By using the FileDialog method in Microsoft Office Access 2003, you can display the File dialog box that is used by Microsoft Access and to determine the files that the user selects. The SelectedItems collection of the FileDialog object contains the paths to the files that are selected by the user. By using a For-Each loop, you can enumerate this collection and then display each file. The following example loops through the ItemsSelected collection and then displays files in the list box.
Microsoft provides programming examples for illustration only, without warranty either expressed or implied. This includes, but is not limited to, the implied warranties of merchantability or fitness for a particular purpose. This article assumes that you are familiar with the programming language that is being demonstrated and with the tools that are used to create and to debug procedures. Microsoft support engineers can help explain the functionality of a particular procedure, but they will not modify these examples to provide added functionality or construct procedures to meet your specific requirements.
For more information about what you can do with the file dialog box, in the Visual Basic Editor, click Microsoft Visual Basic Help on the Help menu, type filedialog object in the Search for box in the Assistance pane, and then click Start searching to view the topic.
Contact us for more help
Connect with Answer Desk for expert help.