export data by VBA

  • Thread starter Thread starter Andrew
  • Start date Start date
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.
 
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"
 
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"
 
Back
Top