Access the answers to your technology questions today.
Subscribe Now
30-day free trial. Register in 60 seconds.
What Makes Experts Exchange Unique?
Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.
Try it out and discover for yourself.
Subscribe Now
30-day free trial. Register in 60 seconds.
Join the Community
Give a Little. Get a Lot.
Join the community of experts here and help other tech pros by answering question in your area of expertise. You can earn FREE access to all Experts Exchange's premium features and resources.
Join the Community
by: brewdogPosted on 1998-12-02 at 04:51:27ID: 1969848
Are you assuming that all the import files are coming from the same directory, or different directories? If they're all coming from the same directory, that's easier:
Behind the button to import, do something like this:
Select case right$(txtImportFile)
Case "dbf"
docmd.transfertext acImportDelim, , [NewTableToMake], "c:\YourDirectory\" & txtImportFile, [fieldnames?]
Case "txt"
if chkAppend Then
docmd.transfertext acImportDelim, , [TableToAppendTo], "c:\YourDirectory\" & txtImportFile
Else
docmd.transfertext acImportDelim, , [NewTableToMake], "c:\YourDirectory\" & txtImportFile, [fieldnames?]
End If
Case Else
msgbox "This utility can only be used for txt and dbf files. Please check your entry and try again.", vbinformation, "Invalid File Type Specified"
txtImportFile.setfocus
End Select
If you have to change the directory, then you could build in one of Access' custom directory controls and reference that for the file path.
Hope this helps.
brewdog