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 SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

TransferText imports just the first field!!

Status
Not open for further replies.

siebel2002

Programmer
Oct 8, 2001
102
0
0
US
I am using the following code to import a .txt file into my access table. It only imports just the first of the total 4 fields.


DoCmd.TransferText _
TransferType:=acImportDelim, _
ImportSpecification: "Security Deposit", _
tableName:=tblDeposit, _
fileName:=filePath, _
HasFieldNames:=fieldHeadings

The remaining field names are shown in the imported table, but not the values!

What am I doing wrong? Help!
 
Your import is being controlled by the specification Security Deposit. Try importing it manually and somewhere there is an advanced option or import specification option. See if that will give you acess to the Security Depostit piece so you can view it. It may be the other fields were set up to be skipped. You might also try removing the Import Specification line and seeing what you get.

Good Luck!

 
Thank you.

Yes I set up the import specification, "Security Deposit".It is set up such that no field is skipped. Yest, it only imports just the first field. The column headings for the remaining fields shows up correctly, but without any data.The original txt file has data in all the fields!

Any suggestions please?


This should be a straightforward process & is baffling!


 
Is it possible your import spec includes numeric fields? If you change everything to general (or equivalent since I've never had to do this), does that change anything? If you do it manually without the spec, does is come in as expected?

Good Luck!

PS. Sorry I can't do more here.

 
Hi;;

When I do it manually, with the same data types for the fields, everything gets imported OK...

Still a puzzler..



 
Hi :

Just a quick update... The puzzle is solved. The TransferType had to be changed from acImportDelim to acImportFixed, as my import file was configured fixed width. It was a silly oversight on my part.

Just wanted to share this...
 
Exactly! Truer words were never spoken indeed!!!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top