TransferText - Conditions?

G

Gary Dolliver

Hi all,
I am looking to have a button run a transfertext from a table (paymnets),
but only have it bring in records that meet a certain criteria (field1 is
null). Also, is it possible to only bring in some of the columns of the
table and not all? I am working on getting a payment text file ready to be
imported into IC Verify credit card processing software and it needs only
specifc fields (cc#, exp date, order_ID...), where we collect more for
internal purposes (entry date, entered_by...), but are not needed for
processing. Should I be using a different command?
Any help is appreciated, thanks!
-gary
 
D

Douglas J. Steele

Create a query that returns only what you want, and transfer the query, not
the table.
 
G

Gary Dolliver

Thanks, that does work, but out of curiousity, will this work via VB code or
is a separate query absolutely necessary?
Thanks!
-gary
 
D

Douglas J. Steele

Not sure I understand your question.

If you only want to extract specific data, then you need to create a query.
If you want to export that subset of data, you need to use the query.
 
G

Gary Dolliver

Hi again,
sorry about that. I can definitly go the query route, I was just wondering
if there was any way to accomplish this with using only VB code instead.
Thanks!
-gary
 
D

Douglas J. Steele

Not really. You could, I suppose, open a recordset in code that contains
only those records in which you're interested, loop through the recordset
and write the data out row-by-row using the VBA text file handling commands
(Open #, Print #, Close #), but using the TransferText command with a query
will be much more efficient.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top