Hi,
It looks okay except the path statement to the saved file location. It is non-existent. It needs to be complete. So this line:
docmd.TransferSpreadsheet acExport,acSpreadsheetTypeExcel8,"qry kassatickets van de laatste 31 dagen","Desktop\kassatickets.xls",True,
Should be:
docmd.TransferSpreadsheet acExport, acSpreadsheetTypeExcel8,"qry kassatickets van de laatste 31 dagen","C:\Documents and Settings\All Users\Desktop\kassatickets.xls",True,
I am not sure whose desktop you want to put it on, so I used All Users. You may want to specify a particular user, but All Users means you can send this app to anyone's desktop and on computer.
Also, please consider removing spaces from all your objects name and using Pascal casing, like this:
From "qry kassatickets van de laatste 31 dagen"
To "qryKassaticketsVanDeLaatste31Dagen"
That's actually Camel/Pascal casing, but you get the idea. It makes referencing object names much easier in your code since spaces can cause problems in some queries for example.
Did this help?
mmcdonal
|