export data by VBA

A

Andrew

Hi,
I wish call a sequence of routines that update my tables and export them to
an excel file(c:\report\employee.xls)

So I built this:
function callagain()
call xx
cal xx1
call xx2
end function

what's the phrase to export the tables to excel?

thank u for answer.
 
N

NevilleT

Hi

You need to use a line like

DoCmd.TransferSpreadsheet acExport, , strQueryName, strDocName

First set up a query to extract the data and put it in strQueryName

Dim strQueryName as String
strQueryName = "qryWhateverIwantToNameThe Query"

Then provide a location in strDocName

Dim strDocName as String
strDocName = "C:\My Documents\My Export\Download.xls"
 
A

Andrew

thanks a lot!!! I got it!!!
--
BBB


NevilleT said:
Hi

You need to use a line like

DoCmd.TransferSpreadsheet acExport, , strQueryName, strDocName

First set up a query to extract the data and put it in strQueryName

Dim strQueryName as String
strQueryName = "qryWhateverIwantToNameThe Query"

Then provide a location in strDocName

Dim strDocName as String
strDocName = "C:\My Documents\My Export\Download.xls"
 

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