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!

TransferText Import Calling File Name? 1

Status
Not open for further replies.

Joycelet

IS-IT--Management
Mar 26, 2003
79
GB
Hi

I'm trying to pull the file location from a unbound text box into the TransferText Import DoCmd but it's saying it needs a file name?

Code:
Private Sub Import_File_Click()

Dim LongFileName As String

Me.TxtProfile.Value = LongFileName
DoCmd.TransferText acImportDelim, , "tblImport", LongFileName

End Sub

I'm missing something just don't know what!

Thanks for any help
 
Why not simply this ?
DoCmd.TransferText acImportDelim, , "tblImport", Me!TxtProfile

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
Hi

Thanks for the code - I've entered this and I now get the following error?

Run Time Error "2391"
Field 'F1' Doesnt exist in destination table 'tblImport'

I've tried a manual import on the file and it works fine - I've also exported out the table to text and then reimported to double make sure and all fine.

Any ideas?

Thanks
 
You may have to play with some specifications.

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
Hi

I've sorted out the specifications - just a quick question, do they copy with the database if you put it onto another machine or do you need to recreate on each machine?

Thanks in advance

N
 
The specifications are stored in hidden tables in the database.

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
That's great - thanks for all your help
 

Just to open your apettite
MSysIMEXSpecs which holds info about the specification (date/time format etc) and MSysIMEXColumns which holds info about the fields, can be exported to an excel file.
Then you can edit the excel, delete the records form these tables (using code only) and import back the excel. An easy and fast way. But you 'll have to be causious with the values and keep a safe back up first!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top