1. Go to the Table tab click new and import table
2. Navigate to the table you want to import and click import
3. Within the import text wizard click on advanced in the bottom left corner
4. Here you can define how Access treats the data
5. When you are finnished click save as - remember the name you give it
CODE:
Function ImportDATA()
Dim sFileName As String
sFileName = "PUT THE PATH AND FILENAME HERE"
On Error GoTo ImportDATA_Err
'Import new data into import table
DoCmd.TransferText acImportFixed, "NAME YOU ASSIGNED IN SET UP", "TABLE NAME FOR IMPORT DATA", sFileName, False, ""
DoEvents
'Delete the file when the import is complete so you don't import it twice accidentally
Kill sFileName
DoCmd.SetWarnings True
MsgBox "Import Process Complete...", vbOKOnly, "Success !"
ImportDATA_Exit:
Exit Function
ImportHDDATA_Err:
Select Case Err
Case 3011
MsgBox "The file " & sFileName & " Does not exist...", vbExclamation, "Missing File ..."
Case Else
MsgBox Error$
End Select
Resume ImportDATA_Exit
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.