PearlGI
Registered User.
- Local time
- Today, 19:44
- Joined
- Aug 30, 2001
- Messages
- 125
I'm using the following lines to output a series of reports to rtf format files.
While Not rs1.EOF
DoCmd.OutputTo acOutputReport, rs1!rname, acFormatRTF, strPath & rs1!rname & ".doc"
rs1.MoveNext
Wend
This works fine.
However, when I distribute the db with the database window hidden, it falls over when attempting to output the 2nd report and gives this error message:
2046: The command or action 'OutputTo' isn't available now
The problem appears to lie with the fact that the database is hidden.
I've tried using [DoCmd.RunCommand acCmdWindowUnhide] before the loop and [DoCmd.RunCommand acCmdWindowHide] after the loop to temporarily unhide the window. But this requires a [SendKeys Chr(13)] before the unhide command as a dialogbox pops-up asking which window to unhide (although there is only 1
).
This solution only works if the db has focus because of the SendKeys action.
Can anybody think of any other solution?
While Not rs1.EOF
DoCmd.OutputTo acOutputReport, rs1!rname, acFormatRTF, strPath & rs1!rname & ".doc"
rs1.MoveNext
Wend
This works fine.

However, when I distribute the db with the database window hidden, it falls over when attempting to output the 2nd report and gives this error message:
2046: The command or action 'OutputTo' isn't available now
The problem appears to lie with the fact that the database is hidden.
I've tried using [DoCmd.RunCommand acCmdWindowUnhide] before the loop and [DoCmd.RunCommand acCmdWindowHide] after the loop to temporarily unhide the window. But this requires a [SendKeys Chr(13)] before the unhide command as a dialogbox pops-up asking which window to unhide (although there is only 1

This solution only works if the db has focus because of the SendKeys action.
Can anybody think of any other solution?