View Single Post
  #2 (permalink)  
Old April 27th, 2006, 06:35 AM
mmcdonal mmcdonal is offline
Friend of Wrox
Points: 9,611, Level: 42
Points: 9,611, Level: 42 Points: 9,611, Level: 42 Points: 9,611, Level: 42
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Mar 2004
Location: Washington, DC, USA.
Posts: 3,069
Thanks: 0
Thanked 10 Times in 10 Posts
Default

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