I am using access 2003. I am trying to import a file and I keep on getting the error 31519. You cannot import this file. I have tested the mask called IMP_CA_Worx and the mask is working. To do the manual import I had to change the file to a text file. I copied and pasted the file name to verify I was not typing incorrectly. The name of the file is VRA03061(Gragil)_AL.C01. The file is being passed to the procedure without a problem. I have highlighted in blue where the error is. Any help would be appreciated.
Tom
Tom
Code:
Private Sub cmdImp_Click()
Dim strFile As String
Dim boolWorx As Boolean
'On Error GoTo Err_Imp
DoCmd.SetWarnings False
' Get File Name
Me.txtFile.SetFocus
strFile = "\\server\xfer\caf\" & (Trim(Me.txtFile.Text))
Me.chkWorx.SetFocus
If (Me.chkWorx.Value = -1) Then
boolWorx = True
Else
boolWorx = False
End If
' Process File
With DoCmd
.OpenQuery "qry_del_ImpTbl"
.OpenQuery "qry_del_ProcTbl"
End With
If (boolWorx = False) Then
DoCmd.TransferText acImportFixed, "IMP_CA", "imp_CA", strFile
Else
[Blue] DoCmd.TransferText acImportFixed, "IMP_CA_Worx", "imp_CA", strFile [/Blue]
End If
With DoCmd
.OpenQuery "qry_app_PostWOAmts"
.OpenQuery "qry_updt_MoveDecimal"
End With
DoCmd.SetWarnings True
MsgBox "Successfully Imported!", , "WHOO!"
'Exit Sub
'Err_Imp:
' MsgBox "ERROR: This did not work, probably because there is not file by that name in the folder.", , "ERROR"
' MsgBox "If there is, I blame you, because computers rule!", , "ERROR"
' Exit Sub
End Sub