Error 2046 when using OutputTo

  • Thread starter Thread starter RichardGarfield
  • Start date Start date
R

RichardGarfield

This is a re-post from Forms Coding in case I was in the wring place:

I am using 'OutputTo' to generate a report in snapshot format.

It works perfectly when I bypass the StartUp form with the shift key, so
that it goes into edit mode. But when I start the database as a user would
do, and get to the snapshot generation code, I get the error message "2046:
The command or action 'OutputTo isn't available".

Would appreciate some expert advice.

Richard
 
RichardGarfield said:
This is a re-post from Forms Coding in case I was in the wring place:

I am using 'OutputTo' to generate a report in snapshot format.

It works perfectly when I bypass the StartUp form with the shift key, so
that it goes into edit mode. But when I start the database as a user would
do, and get to the snapshot generation code, I get the error message "2046:
The command or action 'OutputTo isn't available".

Would appreciate some expert advice.

Richard

Are you jumping straight into the snapshot generation code in the Open or
Load event of your startup form? If so, try moving that code into the Timer
event if you can, with an interval of 1, then just set the interval back to
0 as the very first thing in the Timer event.

That may or may not be the problem, but I've seen wonky behaviour like this
sometimes in Access when it doesn't have a chance to "settle down" after
startup, so it's worth a try.



Rob
 
Thank for the suggestion, Rob.

The snapshot generation only occurs when a command button is activated on
the main form. It occurs in Stephen Lebans's code for converting a snapshot
file to PDF and is in its own module.

When the user starts the program, the main form appears immediately;
otherwise there is no difference from when I am in edit mode.
 
Thank for the suggestion, Rob.

The snapshot generation only occurs when a command button is activated on
the main form. It occurs in Stephen Lebans's code for converting a snapshot
file to PDF and is in its own module.

When the user starts the program, the main form appears immediately;
otherwise there is no difference from when I am in edit mode.

Try putting a DoEvents in the line before the code that fails. Maybe
Access is still doing something under the covers. at any rate, if it
doesn't work it's a simple change....
 
Many thanks for suggestion - tried it but still no joy! Tearing my hair,
because it works perfectly in test.
 
Any luck yet? I'm having exactly the same problem. It seems to be something
to do with the database window.
 
Back
Top