Search code examples
ms-accessvbams-access-97

How to use VBA to browse to file in Access 97?


I'm trying to write a message dialog to prompt the user to point to a TXT file that will be analysed by the program.

How can I make this file explorer prompt in VBA 97?

There's supposed to be a 'openfile' function somewhere but I can't find it. Also the description of the object applications doesn't seem to mention anything about a file prompt. I noticed that in newer versions there's a class called OpenFileDialog and another called FileDialog that seems it would do the trick, but, again, it doesn't seem to be available in Access 97


Solution

  • You want the Common Dialog Control:

    http://access.mvps.org/access/api/api0001.htm

    http://support.microsoft.com/kb/824272