From: gmazza via AccessMonster.com on
Thanks again Douglas, works perfect! Now the only problem is my export that I
replied to an earlier message you wrote me. It said this:
Thanks Douglas.
I changed it and now I am gettting an error for my code below:
strFile = "P:\Navision ERP\MEI Files\ToNav\SCMHeader" & Format(Sequence,
"0000000") & ".txt"
DoCmd.TransferText acExportDelim, "455ExportSpecs", "SCMHeader", strFile,
True

Error is: Tge Microsoft Office Access database engine could not find the
object 'SCMHEADER0000001#txt'. Make sure the object exists and that you spell
its name and the path correctly.

I even tried ditching the strfile and I just put a normal pat in of P:\
SCMHeader.txt and I get the same error, this time saying SCMHeader#txt can't
be found.

I don't understand this error? I don't need to find it, I want it exported to
this file.
Thanks!

Douglas J. Steele wrote:
>strFile would need to be "F:\IT\db\Sales\Archive\450aa.csv" in that case
>(i.e.: you do not want the reference to the Dir function). Is it?
>
>In answer to your other question, you need code like:
>
>Dim strFolder As String
>Dim strFile As String
>
> strFolder = ""F:\IT\db\Sales\Archive\"
> strFile = Dir(strFolder & "450*.csv")
> Do While Len(strFile) > 0
> DoCmd.TransferText acImportDelim, "450ImportSpecs", "450Export",
>strFolder & strFile
> strFile = Dir()
> Loop
>
>> Thats not the problem anyway as I just changed the filename to 450aa.csv
>> which does exist and it still said you cannot import this file.
>[quoted text clipped - 5 lines]
>>>and files names cannot have special characters, such as the asterisk, in
>>>them.

--
Message posted via AccessMonster.com
http://www.accessmonster.com/Uwe/Forums.aspx/access-formscoding/200911/1

From: Douglas J. Steele on
The error message implies that you've got

& "#txt"

not

& ".txt"

I'm confused, though. I showed you how to find all the .csv files starting
with 455 in a particular folder. Why are you using an extension of txt?

--
Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(no e-mails, please!)


"gmazza via AccessMonster.com" <u37142(a)uwe> wrote in message
news:9f8e0c0deeeba(a)uwe...
> Thanks again Douglas, works perfect! Now the only problem is my export
> that I
> replied to an earlier message you wrote me. It said this:
> Thanks Douglas.
> I changed it and now I am gettting an error for my code below:
> strFile = "P:\Navision ERP\MEI Files\ToNav\SCMHeader" & Format(Sequence,
> "0000000") & ".txt"
> DoCmd.TransferText acExportDelim, "455ExportSpecs", "SCMHeader", strFile,
> True
>
> Error is: Tge Microsoft Office Access database engine could not find the
> object 'SCMHEADER0000001#txt'. Make sure the object exists and that you
> spell
> its name and the path correctly.
>
> I even tried ditching the strfile and I just put a normal pat in of P:\
> SCMHeader.txt and I get the same error, this time saying SCMHeader#txt
> can't
> be found.
>
> I don't understand this error? I don't need to find it, I want it exported
> to
> this file.
> Thanks!
>
> Douglas J. Steele wrote:
>>strFile would need to be "F:\IT\db\Sales\Archive\450aa.csv" in that case
>>(i.e.: you do not want the reference to the Dir function). Is it?
>>
>>In answer to your other question, you need code like:
>>
>>Dim strFolder As String
>>Dim strFile As String
>>
>> strFolder = ""F:\IT\db\Sales\Archive\"
>> strFile = Dir(strFolder & "450*.csv")
>> Do While Len(strFile) > 0
>> DoCmd.TransferText acImportDelim, "450ImportSpecs", "450Export",
>>strFolder & strFile
>> strFile = Dir()
>> Loop
>>
>>> Thats not the problem anyway as I just changed the filename to 450aa.csv
>>> which does exist and it still said you cannot import this file.
>>[quoted text clipped - 5 lines]
>>>>and files names cannot have special characters, such as the asterisk, in
>>>>them.
>
> --
> Message posted via AccessMonster.com
> http://www.accessmonster.com/Uwe/Forums.aspx/access-formscoding/200911/1
>


From: gmazza via AccessMonster.com on
I don't have that extension, I have & ".txt"

Yes, I found all the .csv files that I needed to import.
Once I manipulate the data I need to export it out to a .txt file which is
when it gives me the error.
I just don't understand why I would get an error saying the file can't be
found, I don't need anything found for an export, I give the name and
requirements and it should export accordingly.

This is my 2 lines of code and it is failing on the 2nd line:

strFile = DLookup("Directory450", "ExportDirectory") & "SCMHeader" & Format
(Sequence, "0000000") & ".txt"

DoCmd.TransferText acExportDelim, "455ExportSpecs", "SCMHeader", strFile,
True

Douglas J. Steele wrote:
>The error message implies that you've got
>
>& "#txt"
>
>not
>
>& ".txt"
>
>I'm confused, though. I showed you how to find all the .csv files starting
>with 455 in a particular folder. Why are you using an extension of txt?
>
>> Thanks again Douglas, works perfect! Now the only problem is my export
>> that I
>[quoted text clipped - 42 lines]
>>>>>and files names cannot have special characters, such as the asterisk, in
>>>>>them.

--
Message posted via AccessMonster.com
http://www.accessmonster.com/Uwe/Forums.aspx/access-formscoding/200911/1

From: Douglas J. Steele on
What's in strFile when the TransferText command is running?

--
Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(no e-mails, please!)


"gmazza via AccessMonster.com" <u37142(a)uwe> wrote in message
news:9f8f3c0086757(a)uwe...
>I don't have that extension, I have & ".txt"
>
> Yes, I found all the .csv files that I needed to import.
> Once I manipulate the data I need to export it out to a .txt file which is
> when it gives me the error.
> I just don't understand why I would get an error saying the file can't be
> found, I don't need anything found for an export, I give the name and
> requirements and it should export accordingly.
>
> This is my 2 lines of code and it is failing on the 2nd line:
>
> strFile = DLookup("Directory450", "ExportDirectory") & "SCMHeader" &
> Format
> (Sequence, "0000000") & ".txt"
>
> DoCmd.TransferText acExportDelim, "455ExportSpecs", "SCMHeader", strFile,
> True
>
> Douglas J. Steele wrote:
>>The error message implies that you've got
>>
>>& "#txt"
>>
>>not
>>
>>& ".txt"
>>
>>I'm confused, though. I showed you how to find all the .csv files starting
>>with 455 in a particular folder. Why are you using an extension of txt?
>>
>>> Thanks again Douglas, works perfect! Now the only problem is my export
>>> that I
>>[quoted text clipped - 42 lines]
>>>>>>and files names cannot have special characters, such as the asterisk,
>>>>>>in
>>>>>>them.
>
> --
> Message posted via AccessMonster.com
> http://www.accessmonster.com/Uwe/Forums.aspx/access-formscoding/200911/1
>


From: gmazza via AccessMonster.com on
strFile = "P:\Nav\SCMHeader0000001.txt"

Douglas J. Steele wrote:
>What's in strFile when the TransferText command is running?
>
>>I don't have that extension, I have & ".txt"
>>
>[quoted text clipped - 31 lines]
>>>>>>>in
>>>>>>>them.

--
Message posted via AccessMonster.com
http://www.accessmonster.com/Uwe/Forums.aspx/access-formscoding/200911/1