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 bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

exporting filtered records

Status
Not open for further replies.

WaltLukeIII

Programmer
Jun 28, 2000
199
US
I have a table that has thousands of records I want to export only a selected group of those records. Specifically those records that are filtered and shown on a form I tried using a select statement in an export spreadsheet coomand as follows but could not get it to work. <br><br>&nbsp;&nbsp;&nbsp;&nbsp;Dim querystr As String<br>&nbsp;&nbsp;&nbsp;&nbsp;<br>If Right(path, 4) = &quot;.xls&quot; Then<br>querystr = &quot;SELECT * FROM [Quoted Parts] _&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;WHERE
# said:
= &quot; & numero1<br><br>DoCmd.TransferSpreadsheet acExport, 5, querystr, path, -1<br> <p>Walt III<br><a href=mailto:SAElukewl@netscape.net>SAElukewl@netscape.net</a><br><a href=
 
The TransferSpreadsheet method will not export a SQL statement. It will however export a table or query, so just save your SQL statement as a query, and then put the query name in the TransferSpreadsheet statement. <p>Jim Lunde<br><a href=mailto:compugeeks@hotmail.com>compugeeks@hotmail.com</a><br><a href= Application Development
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top