Access to excel...

  • Thread starter Thread starter EMILYTAN via AccessMonster.com
  • Start date Start date
E

EMILYTAN via AccessMonster.com

I have a report generated based on the following code"-


Code:


Dim strCriteria As String Dim stDocName As String strCriteria = "
[JobNumberField]= " & Me![JobNumberControl] stDocName = "WIPRawDetailsQuery"
DoCmd.OpenReport stDocName, acViewPreview, , strCriteria



So, I want to have another button which will export the data like the report
to the excel format....
So, is there anyone can help me?
 
You can use the 'Transferspreadsheet' method of the DoCmd object. Check your
VB help file for more information on the following syntax.

DoCmd.TransferSpreadsheet(TransferType, SpreadsheetType, TableName,
FileName, HasFieldNames, Range, UseOA)
 
Back
Top