I have had success importing dat files into a table from one computer. When attempted from a second computer, I received run-time error 75 - Path/File access error. Here is the code behind the button which I came across when trying to find a resolution to import dat files.
The portion in red is where the error occurs. Will the File/Copy function only work if the user has full access to the local drive? Thanks for any insight.
Private Sub cbImportLocMain_Click()
Dim strInputFileName As String
Dim strExt As String
Dim strFileTemp As String
Dim f As Object
strInputFileName = ahtCommonFileOpenSave(OpenFile:=True, _
DialogTitle:="Please select an input file...", _
Flags:=ahtOFN_HIDEREADONLY)
If Len(strInputFileName) - 1 > 0 Then
strExt = Mid(strInputFileName, Len(strInputFileName), ".")
End If
strFileTemp = Replace(strInputFileName, strExt, "_Temp.txt")
FileCopy strInputFileName, strFileTemp
DoCmd.TransferText acImportDelim, , "tblLocMainR0", strFileTemp, True
Kill strFileTemp
End Sub