Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Saving form recordset data to text file.

Status
Not open for further replies.

Kraeg

Programmer
Jun 27, 2002
113
0
0
AU
I have an Access (97) frontend that retrieves data from a SQL Server 2000 database using a pass-through query.
Once the data is showing in the form (continuous), I need to save it in a comma delimited text file. Is there a command or other way to do this? I've been unable to find one.
 
Kraeg,

What I would do is put a command button on the form. OnClick of the button, you can do a couple of things.

1. You can create a simple select query that's limited to your form's recordset and export it using the DoCmd.TransferText command or

2. You can create a recordset, set it to your form's recordset (rst = Me.Recordset), and export it using transfertext.

Look at the transfertext command in VBA. That should do it for you.

-Patrick

Nine times out of ten, the simplest solution is the best one.
 
Thanks, Patrick.

It's Access97 and appears to only have the RecordSetClone property for the form (I see 2003 has a RecordSet property). But it allows me to do what I need.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top