Need to run or execute query to perform my vb code

G

g

Hi Experts,

This button in my form should execute this on click event but the problem is
it is not happening. I'm thinking that I need to run this query first before
this event happen.
If I use OpenQuery it will open the query & I don't wan't that, I only need
to export to excel what ever the result of this query.

DoCmd.TransferSpreadsheet acExport, acSpreadsheetTypeExcel8, "MyQuery",
"C:\Temp\MyQuery", True

Thank you in advance
 
T

tkelley via AccessMonster.com

You don't have to run the query first. Your code looks upon first review.
Try:

--Adding the extension to your destination path "C:\Temp\MyQuery.xls"

Do you not get any message? Does it appear to complete, then there is no
file in your destination?
 
G

g

Works fine now, actually the only thing I did is recreate the code. Actually
the code is working fine but when I change the query it running that problem
started. Thanks for replying.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top