Output Specification and Exporting TXT

  • Thread starter Thread starter RonH
  • Start date Start date
R

RonH

On an Access form button, when using Docmd.TransferText,
Access is ignoring the Output Specification criteria
regarding Text Qualifier "none". If I Export the query
manually, all is fine. When I use a command line such as:
{DoCmd.TransferText acExportDelim, BHDF,
qryBHDF, "C:\ANEW_BHDF.CSV", -1} where 'BHDF' is the saved
Specification Name, I still get the quotes around text
fields. I guess this is one for Microsoft because the only
thing I can see is that it's a bug in their code. But, if
anyone has any suggestions... please reply. I am all up to
date with Microsoft's torturous updates. Also... is there
anyway to change the DoCmd.OutputTo acExportTXT to NOT
include all those graphical outlines around my data, which
is sooo useless, or is this just another thing that will
NOT change about Access?
 
Hi Ron,

You say
DoCmd.TransferText acExportDelim, BHDF,
qryBHDF, "C:\ANEW_BHDF.CSV", -1
and
where 'BHDF' is the saved Specification Name.

But if that is the name of the specification, you need to pass it to
TransferText as
"BHDF"
.. Without the quotes, what gets passed to TransferText for a
specification name is the value of the variable called BHDF. If your
code module doesn't declare
Option Explicit
and you haven't assigned a value to BHDF yourself, the effect will be to
pass Null as a specification name; TransferText treats this the same as
if you omitted the specification argument altogether.
 
I'm not sure I understand you... is my line NOT passing
the Specification BHDF? Also, If I go Option explicit... I
have to dim everything... I really don't want to do that,
unless I have to.

DoCmd.TransferText acExportDelim, BHDF, <<< right here
qryBHDF, "C:\ANEW_BHDF.CSV", -1

I don't have BHDF in quotes anywhere...

Ron
-----Original Message-----
Hi Ron,

You say
DoCmd.TransferText acExportDelim, BHDF,
qryBHDF, "C:\ANEW_BHDF.CSV", -1
and
where 'BHDF' is the saved Specification Name.

But if that is the name of the specification, you need to pass it to
TransferText as
"BHDF"
.. Without the quotes, what gets passed to TransferText for a
specification name is the value of the variable called BHDF. If your
code module doesn't declare
Option Explicit
and you haven't assigned a value to BHDF yourself, the effect will be to
pass Null as a specification name; TransferText treats this the same as
if you omitted the specification argument altogether.



On an Access form button, when using Docmd.TransferText,
Access is ignoring the Output Specification criteria
regarding Text Qualifier "none". If I Export the query
manually, all is fine. When I use a command line such as:
{DoCmd.TransferText acExportDelim, BHDF,
qryBHDF, "C:\ANEW_BHDF.CSV", -1} where 'BHDF' is the saved
Specification Name, I still get the quotes around text
fields. I guess this is one for Microsoft because the only
thing I can see is that it's a bug in their code. But, if
anyone has any suggestions... please reply. I am all up to
date with Microsoft's torturous updates. Also... is there
anyway to change the DoCmd.OutputTo acExportTXT to NOT
include all those graphical outlines around my data, which
is sooo useless, or is this just another thing that will
NOT change about Access?

--
John Nurick [Microsoft Access MVP]

Please respond in the newgroup and not by email.
.
 
If you used Option Explicit, you'd have to Dim everything ... but you
wouldn't have this kind of problem<g>

..okay, I got it... my bad.

here's what fixed it.

Dim bhdf As String
bhdf = "BHDF"

thanks a bunch! You saved me a lot of trouble fixing
another app written in VB.

It's easy to have a brainfart given the all the different
kinds of data I work with.

Ron.
WWW.SUPERCHIPS.COM, Visit us...
-----Original Message-----
Hi Ron,

You say
DoCmd.TransferText acExportDelim, BHDF,
qryBHDF, "C:\ANEW_BHDF.CSV", -1
and
where 'BHDF' is the saved Specification Name.

But if that is the name of the specification, you need to pass it to
TransferText as
"BHDF"
.. Without the quotes, what gets passed to TransferText for a
specification name is the value of the variable called BHDF. If your
code module doesn't declare
Option Explicit
and you haven't assigned a value to BHDF yourself, the effect will be to
pass Null as a specification name; TransferText treats this the same as
if you omitted the specification argument altogether.



On an Access form button, when using Docmd.TransferText,
Access is ignoring the Output Specification criteria
regarding Text Qualifier "none". If I Export the query
manually, all is fine. When I use a command line such as:
{DoCmd.TransferText acExportDelim, BHDF,
qryBHDF, "C:\ANEW_BHDF.CSV", -1} where 'BHDF' is the saved
Specification Name, I still get the quotes around text
fields. I guess this is one for Microsoft because the only
thing I can see is that it's a bug in their code. But, if
anyone has any suggestions... please reply. I am all up to
date with Microsoft's torturous updates. Also... is there
anyway to change the DoCmd.OutputTo acExportTXT to NOT
include all those graphical outlines around my data, which
is sooo useless, or is this just another thing that will
NOT change about Access?

--
John Nurick [Microsoft Access MVP]

Please respond in the newgroup and not by email.
.
 
Back
Top