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 gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Hide DB Window get OutputTo Error

Status
Not open for further replies.

benw

Technical User
Nov 13, 2001
7
GB
Hello

I am using Access 2002. I have hidden the main DB window as part of the AutoExec startup code.

I have some code to send data from a query to an Excel file using:
DoCmd.OutputTo acQuery, stDocName, acFormatXLS

I check the query first for records - if there are none the application returns to the menu.

When I run this "report" with the main DB window open (not hidden) it works fine and displays the OutputTo / file selector window as expected.

When I run this report with the main DB window hidden, I get the error:

"2046: The command or action 'OutputTo' isn't available now."

Any clues?

Cheers, Ben
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top