Prompting a user for file name on import

N

Nicole

Hi,
We are using Access 2000. I have three users who create
various text files. All files need to be imported at one
time or another and the names vary. I would like the
users to be prompted to enter the file name of the text
file to be imported. Is this possible? If so, how. I
appreciate it.
 
R

Ronald W. Roberts

Nicole said:
Hi,
We are using Access 2000. I have three users who create
various text files. All files need to be imported at one
time or another and the names vary. I would like the
users to be prompted to enter the file name of the text
file to be imported. Is this possible? If so, how. I
appreciate it.
This will allow you to open th eWindows Open or save dialog box.

www.mvps.org/access/api/api0001.htm

Ron
 
J

Joe Fallon

For older versions of Access try this:
http://www.mvps.org/access/api/api0001.htm

This code is a new feature in Access 2002.
It allows you to browse for a file and then store the selected file in 2
text boxes:
Me![txtLocalDir] , Me![txtLocalFileName]

'1 = DialogOpen, 2= SaveAs, 3=FilePicker, 4 = FolderPicker
'Cannot be used in Access 2000!
With Application.FileDialog(3)
.AllowMultiSelect = False
If .Show = True Then
Me![lblEdit].Visible = True
Me![txtLocalDir] = Left$(.SelectedItems(1),
InStrRev(.SelectedItems(1), "\"))
Me![txtLocalFileName] = Right$(.SelectedItems(1),
Len(.SelectedItems(1)) - InStrRev(.SelectedItems(1), "\"))
Me![txtLocalFileName].SetFocus
End If
End With
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top