Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Reference default My Documents folder in Access97

Status
Not open for further replies.

ehicks727

Programmer
Oct 26, 2004
36
US
You'll have to excuse me, I'm not a Microsoft programmer, (I just play one on TV).... so please correct me if I have some funky code that doesn't make sense to you seasoned vets.

I've got a button that I want to save a query as an excel doc and then launch excel with that doc open. I found a reference to a FAQ containing a fHandleFile function, and it works well. My struggle is finding a generic way to reference the user's My Documents folder. I am using Access 97 and have a mixture of XP and 98 desktops. Here is the code I have so far and it works, but please let me know if there is a better way of launching excel! But my main question is how do I reference the My Documents folder. I will change the c:\temp\... to this reference. Thank you!

Code:
DoCmd.OutputTo acOutputQuery, "qryMyProviders", acFormatXLS, "c:\temp\MyProviders.xls"
Dim var
var = modHandleFile.fHandleFile("C:\TEMP\MyProviders.xls", WIN_NORMAL)
 
I think I figured a way around my problem... I just need to set the Autostart to true and leave the filename blank and let the user name their own filename. It defaults to the My Documents folder anyway.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top