Hello All,
I'm using this Code to have a query pipe/export its results out to an excel spreadsheet. And it works great!
I have setup prompts in the query for different buildings, so I want to run this query for building "A", "B" ,"C" and then have the results pipe/export to separate excel file. ie A.xls, B.xls, C.xls
Any Ideas, this my first attempt at working with VB, so any help would be great..
thanks,
pete
I'm using this Code to have a query pipe/export its results out to an excel spreadsheet. And it works great!
Code:
Sub export_to_excel()
Dim mfile
myfile = "Your path name/spreadsheet name.xls"
DoCmd.TransferSpreadsheet acExport, acSpreadsheetTypeExcel9, "your query name", myfile
End Sub
I have setup prompts in the query for different buildings, so I want to run this query for building "A", "B" ,"C" and then have the results pipe/export to separate excel file. ie A.xls, B.xls, C.xls
Any Ideas, this my first attempt at working with VB, so any help would be great..
thanks,
pete