Exporting a query

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Is there a way i can export 2 fields from query using a command button from a
form and have it save the results as an excel file.
 
Create a new query that returns only the two fields you want to export and
base it on your existing query. This is so it will ensure you are returning
the same rows as the originaly query and if any changes are required, you
only have to modify one query. Now use the new query in the Table Name
argument of the TransferSpreadsheet method.
 
You will find a complete description of the TransferSpreadsheet method in VBA
Help; however, that argument tells TransferSpreadsheet which table or query
to export.
 

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

Back
Top