Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

TransferText method -- pass parameterized query?

42 views
Skip to first unread message

Jeff

unread,
Nov 9, 2009, 8:04:11 PM11/9/09
to
I have this pretty big dataset and output 70+ csvs to a charting
program twice a year ... be lovely to loop through the dataset to
output my text files.

Took the approach of creating 1) parameterized query through VBA:

...parameterize query beforehand works fine:
Set qParameterized = CurrentDb.QueryDefs!qryDataset
qParameterized.Parameters![param1] = strParamOne
qParameterized.Parameters![param2] = strParamTwo

Then 2) output the value using TransferText method:
DoCmd.TransferText acExportDelim, , "qryDataset", "C:\DEV\test.csv"

...but since I'm passing the object to DoCmd.TransferText I don't get
to pass the parameters along, apparently.

Insight appreciated, high-centered on this all Monday. Thanks!

(PeteCresswell)

unread,
Nov 9, 2009, 8:31:25 PM11/9/09
to
Per Jeff:

>
>Then 2) output the value using TransferText method:
>DoCmd.TransferText acExportDelim, , "qryDataset", "C:\DEV\test.csv"
>
>...but since I'm passing the object to DoCmd.TransferText I don't get
>to pass the parameters along, apparently.
>
>Insight appreciated, high-centered on this all Monday. Thanks!


"Insight" might be to elegant a word... but here's what I'd do is
point the query's parms to invisible fields on a form that is
open at the time of the process and pre-populate those fields
accordingly.
--
PeteCresswell

Chuck Grimsby

unread,
Nov 12, 2009, 7:25:36 PM11/12/09
to

Rather then doing all that with TransferText, why not roll our own
delimited text export and do it yourself! It may actually be faster!

0 new messages