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

Open File dialog box??? How?

Status
Not open for further replies.

ParaTrooper

Technical User
Feb 5, 2002
16
0
0
US
Hi Everyone,

I am developing an Access 2000 DB where the users need to update the data in a linked table (text file) by selecting the most current file on a network drive.

The path of the most current file is not always the same, nor is the name. I have overcome this by copying the most current file to a temporary location and giving it a common name (the linked table is linked to the temporary file).

My only problem is how do I prompt the users to select the most current file? How do I get an Open File dialog box to pop up that returns the full path of the file the users select?

I have done this before in excel, and the only solution I have come up with in Access is to use an excel application object as so:

Dim tempFile As String
tempFile = "C:\windows\vehicle_regestration.txt"
Dim ex As Excel.Application
Set ex = New Excel.Application
Dim fileToOpen As String
fileToOpen = ex.GetOpenFilename()

If fileToOpen <> &quot;False&quot; Then
'//Place copy on local drive
copyFile(fileToOpen, tempFile)
End If


Thanks in advance for your help,
ParaTrooper
 
There are two FAQs describing different ways to do this. One is in the Microsoft: Access Modules forum, the other is in this forum. Use the Advanced Search feature (see link at top of page) and search for FAQs with all the words &quot;file open common dialog&quot;. Rick Sprague
To write a program from scratch, first create the universe. - Paraphrased from Albert Einstein
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top