PSUIVERSON
Technical User
Within VBA i have created a function that imports .txt files into ACCESS. Here is the code you need to do this:
DoCmd.TransferText _
TransferType:=acImportDelim, _
tableName:=tblNAME, _
fileName:=filePath, _
HasFieldNames:=fieldHeadings
HOWEVER!!!!
When transferring in comma delimited files this works great. When you receive ANOTHER Type of .txt file that you need to have a custom import - YOU NEED TO:
1) Work through the ACCESS import wizard and manually set the parsing
2) Then at the every end once you have customized the import rules for that file (Because it will appear the same each month after month) you can save the SPECIFICATION NAME under the ADVANCED tab in the Wizard and this becomes like a template for importing that file.
3) Then when executing vba code each month I can import as above BUT WHEN ENTERING THE CODE IT NEEDS TO BE:
DoCmd.TransferText _
TransferType:=acImportDelim, _
HERE I NEED TO ENTER THE SPECIFICATION NAME I BELIEVE!?
tableName:=tblNAME, _
fileName:=filePath, _
HasFieldNames:=fieldHeadings
I can't find anything on it!?
If you are looking at - check out the MACRO for text import. When selecting IMPORT FIXED WIDTH it wants a specification name. I need to know how to put this in VBA.
Anyone????
Baffled.
DoCmd.TransferText _
TransferType:=acImportDelim, _
tableName:=tblNAME, _
fileName:=filePath, _
HasFieldNames:=fieldHeadings
HOWEVER!!!!
When transferring in comma delimited files this works great. When you receive ANOTHER Type of .txt file that you need to have a custom import - YOU NEED TO:
1) Work through the ACCESS import wizard and manually set the parsing
2) Then at the every end once you have customized the import rules for that file (Because it will appear the same each month after month) you can save the SPECIFICATION NAME under the ADVANCED tab in the Wizard and this becomes like a template for importing that file.
3) Then when executing vba code each month I can import as above BUT WHEN ENTERING THE CODE IT NEEDS TO BE:
DoCmd.TransferText _
TransferType:=acImportDelim, _
HERE I NEED TO ENTER THE SPECIFICATION NAME I BELIEVE!?
tableName:=tblNAME, _
fileName:=filePath, _
HasFieldNames:=fieldHeadings
I can't find anything on it!?
If you are looking at - check out the MACRO for text import. When selecting IMPORT FIXED WIDTH it wants a specification name. I need to know how to put this in VBA.
Anyone????
Baffled.