Prompting a user for file name on import

  • Thread starter Thread starter Nicole
  • Start date Start date
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.
 
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
 
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
 
Back
Top