Hi,
This code will do it for you.
Design a new module (or manipulate this with Private Subs instead of Functions and place in your form) and copy/paste this into it. Change qryTestPlease to your query or table that you are trying to export. And change C:\Testplease.xls to your spreadsheet that you export to and that you want to open.
Function SpreadSheet()
Dim gsSpreadSheet As String
Dim successful
Save it as mdlSpreadSheet (or whatever)... Now just call the function whenever you want it to run.
-Josh ------------------
-JPeters Got a helpful tip for Access Users? Check out and contribute to 'How to Keep Your Databases from becoming Overwhelming!'
thread181-293590
jpeters@guidemail.com
------------------
Do I put this code in the form that the user uses to run the report? Or should I make a report, put the code there, and have it create the spreadsheet? I really want to skip the report and go from the form straight to the spreadsheet.
Thanx
Hey,
There's no report that opens up with this code. Just a spreadsheet. You'll notice that you have to edit the code to change the paths so they match your comp's specs. Ie: rename the Xls paths, etc.
You can either make a module and copy/paste that in there with the Function heading. Or you can create a button, and put the code behind the button (but you don't want to copy.paste the Function () and End Function ... Access should create Private Sub () and End Sub). IF you need any more help, just post.
-Josh ------------------
-JPeters Got a helpful tip for Access Users? Check out and contribute to 'How to Keep Your Databases from becoming Overwhelming!'
thread181-293590
jpeters@guidemail.com
------------------
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.