this used to work and then all of a sudden stopped without any changes being made. In code I find all .dat files and show them in a import screen when I click the file I want an error comes up "You cannot open this file" with only an ok button option. When I try to write a .dat file I get an error "Database or Object is read-only". I can import and export .txt, .tmp but not .dat (or .abc either for that matter)
Here is the import code (export is very similar):
On Error GoTo BErr
Dim strFile$
dlgFile.FileName = ""
dlgFile.CancelError = False
dlgFile.DialogTitle = "Open Import Data File"
'dlgFile.InitDir = App.Path
dlgFile.Filter = "Fuel Import (*.dat)|*.dat|Text Files (*.txt)|*.txt|All Files (*.*)|*.*"
dlgFile.DefaultExt = "dat"
dlgFile.FilterIndex = 0
dlgFile.ShowOpen
strFile = dlgFile.FileName
If strFile = "" Then
Exit Function
End If
DoCmd.TransferText acImportDelim, "Fuel Import", "Fuel", strFile