OutputTo doesn't

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

The command below works sometimes but other times it generates the following
error message 'The Command or Action OutputTO isn't availabe now.' The
Q_Printer is a simple select query.

DoCmd.OutputTo acOutputQuery, "Q_Printer", acFormatXLS, "a:\PrintersFile.xls"

Thanks in advance for any help
 
Alex - Thanks for suggestions.

I think the errors that I have encountered can be eliminated if the
database window is unhidden before the the OutPutTo command is run, i.e

DoCmd.RunCommand acCmdWindowUnHide
DoCmd.OutptTo acOutputQuery, "Q_Printer", acFormat XLS, "a:\PrintersFile.xls"
DoCmd.RunCommand acCmdWindowHide

Again, Thanks!
 
Back
Top