mike.molina
Registered User.
- Local time
- Yesterday, 23:34
- Joined
- Jul 2, 2014
- Messages
- 12
[SOLVED] Hair is coming out (VBA HELP)
Hello All,
I have a database in which I am importing data from .csv to an Access table. I keep getting a run-time error of 2391 which reads "Field XXX doesn't exist in destination table 'Subinv'" The "XXX" is where the error display some weird characters. Below is the code I am using to import the CSV into the existing Access table:
PLEASE HELP
Hello All,
I have a database in which I am importing data from .csv to an Access table. I keep getting a run-time error of 2391 which reads "Field XXX doesn't exist in destination table 'Subinv'" The "XXX" is where the error display some weird characters. Below is the code I am using to import the CSV into the existing Access table:
Code:
'===============IMPORT GROUP DATA=====================
Private Sub Command35_Click()
Dim filepath As String
filepath = "C:\UUAM\Subinv.csv"
If FileExist2(filepath) Then
DoCmd.TransferText acImportDelim, , "Subinv", filepath, True
Else
MsgBox "File not found. Please check file name, file extension or file location."
End If
End Sub
Function FileExist2(sTestFile As String) As Boolean
Dim lsize As Long
On Error Resume Next
lsize = -1
lsize = FileLen(sTestFile)
If lsize > -1 Then
FileExist2 = True
Else
FileExist2 = False
End If
MsgBox ("Subinv Data upload successfully")
End Function
Last edited: