66tigger40
asked on
TransferText FileName - Setting from a textbox?
Hi All
I have a unbound text box that holds the full path of a file I want to include in my transfertext - I've tried the following code, but it still tells me that I need a filename?
Dim strLongFileName As String
Me.TxtProfile.Value = strLongFileName
DoCmd.TransferText acImportDelim, , "tblImport", strLongFileName, False
What have i missed out?
Thanks in advance
I have a unbound text box that holds the full path of a file I want to include in my transfertext - I've tried the following code, but it still tells me that I need a filename?
Dim strLongFileName As String
Me.TxtProfile.Value = strLongFileName
DoCmd.TransferText acImportDelim, , "tblImport", strLongFileName, False
What have i missed out?
Thanks in advance
Putting it in context:
Dim strLongFileName As String
strLongFileName=Me.TxtProf ile
DoCmd.TransferText acImportDelim, , "tblImport", strLongFileName, False
Dim strLongFileName As String
strLongFileName=Me.TxtProf
DoCmd.TransferText acImportDelim, , "tblImport", strLongFileName, False
ASKER
Hi
I've tried this and I get an error message saying I can't import this file?
Any ideas
Thanks
I've tried this and I get an error message saying I can't import this file?
Any ideas
Thanks
Try putting in a messagebox statement:
Dim strLongFileName As String
strLongFileName=Me.TxtProf ile
msgBox strLongFileName
DoCmd.TransferText acImportDelim, , "tblImport", strLongFileName, False
Does the message box show the file name correctly? Also verify that the file exists exactly as specified.
Beyond that, What is the exact error number/message?
Dim strLongFileName As String
strLongFileName=Me.TxtProf
msgBox strLongFileName
DoCmd.TransferText acImportDelim, , "tblImport", strLongFileName, False
Does the message box show the file name correctly? Also verify that the file exists exactly as specified.
Beyond that, What is the exact error number/message?
ASKER
Hi
Yes the file name is correct
The message I'm now getting is the following:
Runtime 2391
Field F1 Doesnt exist in destination table 'tblImport'
Thanks for all your help so far
Yes the file name is correct
The message I'm now getting is the following:
Runtime 2391
Field F1 Doesnt exist in destination table 'tblImport'
Thanks for all your help so far
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
66tigger40,
Do you still need help with this?
Do you still need help with this?
If that is typed into your textbox, try this:
strLongFileName=Me.TxtProf