Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Specification Name - How Do I Enter It?

Status
Not open for further replies.

PSUIVERSON

Technical User
Nov 6, 2002
95
US
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.
 
Import your text file and click the Advanced button in the lower left of the Import Text Wizard screen. Setup your specs and click the Save As button. Then you can use that specification in your TransferText Code. For Example:

Code:
     DoCmd.TransferText acImportDelim, "Stats3test Import Specification2", _
    "Stats3test2", "C:\Stats3.txt"
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top