Re: Import text file with type trx instead of txt

Tech-Archive recommends: Fix windows errors by optimizing your registry

From: Douglas J. Steele (NOSPAM_djsteele_at_NOSPAM_canada.com)
Date: 01/30/05


Date: Sun, 30 Jan 2005 07:01:08 -0500

Export it to a file name ending .txt, then rename the file when you're done.

On rereading that KB article, they've made it far more complicated than is
really required. There's no reason to use FileScriptingObject: VBA has
built-in commands to copy a file (the FileCopy command) and to rename it
(the Name command)

-- 
Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(no e-mails, please!)
"richardb" <richardb@discussions.microsoft.com> wrote in message 
news:2091BA97-A1C8-4AED-BDC3-A0EA1E2AEC9E@microsoft.com...
> The code in the KB article that you referenced worked fine for importing 
> the
> file. Now I need to export the text file with the same trx type to a
> different folder. However, Access will not allow me to do that unless I 
> use
> txt as the output file type. I could not find another KB article about
> exporting to a file name type that Access does not recognize. Can you help 
> me
> again please?
>
> "Douglas J. Steele" wrote:
>
>> See http://support.microsoft.com/?id=306144
>>
>> -- 
>> Doug Steele, Microsoft Access MVP
>> http://I.Am/DougSteele
>> (no e-mails, please!)
>>
>>
>>
>> "richardb" <richardb@discussions.microsoft.com> wrote in message
>> news:6257938B-C077-4D62-ADDB-D0B5BEFAE61A@microsoft.com...
>> > The following method would not work until I changed the file type to 
>> > .TXT.
>> > A
>> > message appeared saying (I think) "Cannot import this file."
>> >
>> > DoCmd.TransferText acImportFixed, "Transaction Import", "tblMyTable",
>> > "G:\MyFolder\01202005.TRX"
>> >
>> > Is there any way to make this file import method work when files are of 
>> > a
>> > type other than TXT?
>> >
>> > Thank you...
>>
>>
>> 


Relevant Pages

  • Re: FileCopy Working 80% of Time
    ... Since you're trying to rename a file, using the Name statement would appear ... Doug Steele, Microsoft Access MVP ... That means the Kill statement ...
    (microsoft.public.access.modulesdaovba)
  • Re: Import text file with type trx instead of txt
    ... >> Doug Steele, Microsoft Access MVP ... >> (no e-mails, please!) ... >>> VBA Kill command to delete a file? ...
    (microsoft.public.access.externaldata)
  • Re: problem with short date
    ... You say you want to add a "Duplicate record" command but you get an error ... Doug Steele, Microsoft Access MVP ...
    (microsoft.public.access.forms)
  • Re: Displaying custom help with a mde file in the runtime
    ... All I ever do is create an AutoKeys macro that remaps the F1 key to run the ... appropriate command to open the file. ... Doug Steele, Microsoft Access MVP ...
    (microsoft.public.access.devtoolkits)
  • Re: Import text file with type trx instead of txt
    ... > VBA Kill command to delete a file? ... >> Doug Steele, Microsoft Access MVP ... >> (no e-mails, please!) ...
    (microsoft.public.access.externaldata)